Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move WebTestCase to "Functional" namespace instead of "Units" #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

move WebTestCase to "Functional" namespace instead of "Units" #54

wants to merge 1 commit into from

Conversation

FlorianLB
Copy link
Member

WebTestCase is a base class for functional tests not units one.

We can keep the old class for BC or just remove it.

@jubianchi
Copy link
Member

To avoid BC break, you can move the class and simply create a class_alias

@FlorianLB
Copy link
Member Author

I don't see how to use class_alias in a PSR-0 autoload context. An idea ?

@jubianchi
Copy link
Member

Forget about PSR-0 :trollface:

No seriously : I would add the class_aliascall somewhere here https://github.com/atoum/AtoumBundle/blob/master/AtoumAtoumBundle.php#L21

The call would look like:

<?php

if(false === class_exists('atoum\AtoumBundle\Test\Units\WebTestCase')) {
    class_alias('atoum\AtoumBundle\Test\Functional\WebTestCase', 'atoum\AtoumBundle\Test\Units\WebTestCase');
}

So that, the alias will be automatically created at when the bundle boots and everything should work fine with any autoloader working with PSR-0.

The only drawback I can think of right now is that even the user won't use the WebTestCase the class will still be loaded as class_alias calls the autoloader. But I don't think it's really important to worry about that ;)

@FlorianLB
Copy link
Member Author

It can't work in a CLI/atoum context. The kernel (and bundles) is booted during the test execution not before like in a SF2 app.

@FlorianLB
Copy link
Member Author

(Using bin/atoum, not the SF2 command)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants