Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

Namespace problem with Form Type #79

Description

@bolbo

Hi,
I have a Symfony2.6 application with a form Type in src/Acme/DemoBundle/Form/Type/ArticleType.php

When I write the test for this form type, I create file src/Acme/DemoBundle/Tests/Units/Form/Type/ArticleTypeTest.php
In this file, if I set namespace:
namespace Acme\DemoBundle\Tests\Units\Form\Type;

and I run the test I have this error:

Running duration: 6.71 seconds.
Failure (2 tests, 1/2 methods, 1 void method, 0 skipped method, 0 uncompleted method, 0 failure, 1 error, 0 exception)!

There is 1 error:
=> Acme\DemoBundle\Tests\Units\Form\Type\ArticleType::testFormType():
==> Error E_USER_ERROR in /sf2-propel-atoum/src/Acme/DemoBundle/Tests/Units/Form/Type/ArticleTypeTest.php on unknown line, generated by unknown file:
Tested class 'Acme\DemoBundle\Units\Form\Type\ArticleType' does not exist for test class 'Acme\DemoBundle\Tests\Units\Form\Type\ArticleType'

If I set namespace: namespace Acme\DemoBundle\Tests\Form\Type;
there is no error

https://github.com/lbol/sf2-propel-atoum/blob/master/src/Acme/DemoBundle/Form/Type/ArticleType.php
https://github.com/lbol/sf2-propel-atoum/blob/master/src/Acme/DemoBundle/Tests/Units/Form/Type/ArticleTypeTest.php

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions