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

use atoum.phar to execute tests when it's needed #66

Open
CedCannes opened this issue Mar 17, 2016 · 3 comments
Open

use atoum.phar to execute tests when it's needed #66

CedCannes opened this issue Mar 17, 2016 · 3 comments

Comments

@CedCannes
Copy link

I use atoum.phar on a project.
When I run a test with the contextual menu, an error appears because bin/atoum isn't found.

In my test file I have to include/require the atoum.phar like this :
require_once __DIR__ . '/atoum.phar';

it may be that detect this kind of require/include in a test file could allow to the plugin executing the atoum.phar to run the tests of this file.

@Grummfy
Copy link
Member

Grummfy commented Mar 17, 2016

for me we should have a configuration part:

  • part to composer tool inside bin directory
  • or to the phar file in the project or not
  • this must have a global configuration but can be adapted to each project

I think is the best possibilites

@agallou
Copy link
Member

agallou commented Mar 18, 2016

First, some personal thought : I don't understand why the phar is used and why atoum is not installed via composer (like that the dependancy could be in different version for each project, and developpers get atoum on the composer install without any next step).

But if people use it, we should support this.

For now we've managed to avoid having configuration, but will have to add one one day (for test generation for example).

@CedCannes how did you include the phar. Is the phar in the root dir of your project ? On a parent folder of the test ? (the file is commited in the repository ?).
(before adding the configuration "path to atoum", we could add an automatic lookup for the phar).

@CedCannes
Copy link
Author

@agallou Usually on my projects, atoum is installed via composer.
This time, on a project that does not belong to me and not using composer, I needed to use atoum without making too many changes in the project.
I thought that the simplest and least intrusive would be use the atoum.phar.
So I created folders for my test files at the project root directories and I included the atoum.phar in it.
[ProjectRootDirectory]/Tests/Units/atoum.phar

In my test files I added atoum.phar as specified in the documentation
require_once __DIR__. '/atoum.phar';
When the two files was created, the class and the test, your plugin does its job and I had access to the atoum menu on right click.
Obviously the test launch does not work, it does not bother me, I use the terminal.
But I thought that by detecting in the test file the line that include atoum.phar the pluggin could decide to execute the test with this phar.

I think you're right, atoum is mostly used with composer, this feature is probably not expected.

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

No branches or pull requests

3 participants