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

PHP Fatal error: Trait 'Aura\Framework\Test\WiringAssertionsTrait' not found #17

Closed
elboletaire opened this issue Oct 13, 2015 · 12 comments

Comments

@elboletaire
Copy link

I'm having issues trying to test a CakePHP 3 plugin and the problem comes when Cake internally loads aura.intl. This is the error shown:

PHP Fatal error:  Trait 'Aura\Framework\Test\WiringAssertionsTrait' not found in /home/elboletaire/www/projectes/metropolitan/web-2015/vendor/cms/files/vendor/aura/intl/tests/WiringTest.php on line 8

Fatal error: Trait 'Aura\Framework\Test\WiringAssertionsTrait' not found in /home/elboletaire/www/projectes/metropolitan/web-2015/vendor/cms/files/vendor/aura/intl/tests/WiringTest.php on line 8

I've found this: auraphp/Aura.Marshal#21 but it is not a valid solution. Making a search on the whole code I can see that the Trait does not exist.

Searching in all your Aura repositories I can see that the trait exists in Aura.Framework, but this framework is not present in the Aura.intl composer file as a requirement.

So, IMHO, this can be due to:

  • Aura.intl does not properly require the libraries in its composer file (adding the framework dependency should fix the issue).
  • CakePHP is not properly loading aura.intl, instead they should load aura.framework + aura.intl.
  • I'm totally wrong and I'm making some stupid error on my tests.
@elboletaire
Copy link
Author

I've just tried a project that was working (and building) and currently crashes due to this issue. You can try it by yourself on this repo: https://github.com/elboletaire/less-cake-plugin

git clone the repo + composer install && phpunit .

@elboletaire
Copy link
Author

This is really weird because you have not made any changes to your code since April and 30 days ago I successfully ran a build.

@elboletaire
Copy link
Author

Given the less-cake-plugin repo I've been able to fix the issue manually-requiring the aura/framework package. But if I do so with the other plugin (the one which originated this issue) then other things break, and that are really weird because the files that cannot find now really exist:

PHP Fatal error:  Class 'Aura\Filter\Rule\MockValue' not found in /home/elboletaire/www/projectes/metropolitan/web-2015/vendor/cms/files/vendor/aura/filter/tests/Aura/Filter/Rule/MethodTest.php on line 38

Fatal error: Class 'Aura\Filter\Rule\MockValue' not found in /home/elboletaire/www/projectes/metropolitan/web-2015/vendor/cms/files/vendor/aura/filter/tests/Aura/Filter/Rule/MethodTest.php on line 38

This makes me think that I'm doing something wrong, but don't know what. Any help would be appreciated.. 😓

Edit (well, I've not edited, I'm writing while investigating): I'm checking others' plugins and I'm having exactly the same issue...

https://github.com/FriendsOfCake/bootstrap-ui
https://github.com/FriendsOfCake/search
https://github.com/FriendsOfCake/crud

I've tried it in other computers and other different PHP versions and have the same issue everywhere.

@harikt
Copy link
Member

harikt commented Oct 14, 2015

@elboletaire wiring test is only for testing with the framework ( v1 ) . It can be removed for v1 is no longer supported . You can also mark skip or ignore it to run the phpunit . I wonder why the vendors are running unit test though.

Hope that helps!

Thanks.

@elboletaire
Copy link
Author

So, the problem is with CakePHP which is loading the test files, right?

@harikt
Copy link
Member

harikt commented Oct 14, 2015

@elboletaire what I was telling was your tests may not need to run the aura/intl tests. I am not sure whether it was cake running all tests for the 3rd party packages.

Probably you can send a PR removing the wiring tests and see what @pmjones think about the removal.

@elboletaire
Copy link
Author

My tests are not running the aura/intl tests.. if they are running is because CakePHP core is running them. That's why I said that "the problem is with CakePHP".

What I would like to know is where should I open a new issue if it is not your fault... but as I can see, in your tests you load a file which is not included (nor in the code files, nor in composer dependencies), so the problem here is with aura/intl.

Am I right?

@harikt
Copy link
Member

harikt commented Oct 15, 2015

@elboletaire I have send a PR with what I think to resolve the issue. Hope that helps. See #18 .

@elboletaire
Copy link
Author

I'm not sure if this will fix my issue but at least we fixed something! 😄

@elboletaire
Copy link
Author

Finally my problem was running phpunit . (with that trailing dot) which runs tests recursively from current path 😅 .

Anyway it served to fix the issue with your tests 😄

@harikt
Copy link
Member

harikt commented Oct 24, 2016

Hi @elboletaire ,

I am closing this for I don't think we will be removing the class Di wiring test. But on another note, we may be pushing a 2.x or 3.x in the mean time. So hopefully everything will be good.

Hope that is ok with you.

Thank you

@harikt harikt closed this as completed Oct 24, 2016
@harikt
Copy link
Member

harikt commented Dec 30, 2016

Just for reference we have released 3.0.0-beta1 : https://github.com/auraphp/Aura.Intl/releases/tag/3.0.0-beta1 . Supports 5.6+ ( PHP 5.6 ends support today ) . ie one reason 5.5 was not added.

@harikt harikt mentioned this issue Dec 30, 2016
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

2 participants