I have a NetBeans project with PHPUnit tests that I am using for learning.
I created it on my desktop PC using NetBeans 8.0.2 it worked fine, but when I imported the project on my notebook PHPUnit don't execute any tests.
This is the output window:
"C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\bin\phpunit.bat" "--colors" "--log-junit" "C:\Users\MARCOA~1\AppData\Local\Temp\nb-phpunit-log.xml" "--configuration" "C:\WebServer\Apache 2.2\htdocs\DataBaseTests\tests\phpunit.xml" "C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php" "--run=C:\WebServer\Apache 2.2\htdocs\DataBaseTests\tests"
Warning: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
Call Stack:
0.0016 130056 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
0.0385 398928 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
0.0386 402664 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
0.1218 887816 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
0.1910 1624632 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1910 1624648 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1911 1625712 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
0.1954 1626688 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
0.2026 1627056 9. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
0.2061 1627360 10. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
0.2229 1628168 11. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
Warning: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
Call Stack:
0.0016 130056 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
0.0385 398928 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
0.0386 402664 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
0.1218 887816 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
0.1910 1624632 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1910 1624648 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1911 1625712 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
0.1954 1626688 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
0.2026 1627056 9. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
0.2061 1627360 10. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
0.2343 1628632 11. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
Warning: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
Call Stack:
0.0016 130056 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
0.0385 398928 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
0.0386 402664 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
0.1218 887816 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
0.1910 1624632 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1910 1624648 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1911 1625712 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
0.1954 1626688 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
0.2026 1627056 9. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
0.2385 1627464 10. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP Warning: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
PHP Stack trace:
PHP 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
PHP 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
PHP 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
PHP 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
PHP 9. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP 10. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP 11. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP Warning: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
PHP Stack trace:
PHP 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
PHP 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
PHP 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
PHP 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
PHP 9. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP 10. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP 11. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP Warning: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
PHP Stack trace:
PHP 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
PHP 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
PHP 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
PHP 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
PHP 9. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP 10. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP Warni
Warning: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
Call Stack:
0.0016 130056 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
0.0385 398928 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
0.0386 402664 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
0.1218 887816 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
0.1910 1624632 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1910 1624648 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1911 1625712 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
0.1954 1626688 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
0.3064 1627160 9. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
Warning: array_merge(): Argument #2 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 115
Call Stack:
0.0016 130056 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
0.0385 398928 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
0.0386 402664 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
0.1218 887816 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
0.1910 1624632 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1910 1624648 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1911 1625712 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
0.3851 1626672 8. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
Warning: Invalid argument supplied for foreach() in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 84
Call Stack:
0.0016 130056 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
0.0385 398928 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
0.0386 402664 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
0.1218 887816 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
0.1910 1624632 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
0.1910 1624648 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHPUnit 4.5.0 by Sebastian Bergmann and contributors.
Configuration read from C:\WebServer\Apache 2.2\htdocs\DataBaseTests\tests\phpunit.xml
Time: 684 ms, Memory: 2.25Mb
No tests executed!
Generating code coverage report in HTML format ... done
ng: array_merge(): Argument #1 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 143
PHP Stack trace:
PHP 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
PHP 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
PHP 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
PHP 8. NetBeansSuite::rglob() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
PHP 9. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:143
PHP Warning: array_merge(): Argument #2 is not an array in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 115
PHP Stack trace:
PHP 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
PHP 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
PHP 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 7. NetBeansSuite::toRun() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:84
PHP 8. array_merge() C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php:115
PHP Warning: Invalid argument supplied for foreach() in C:\Program Files\NetBeans 8.0.2\php\phpunit\NetBeansSuite.php on line 84
PHP Stack trace:
PHP 1. {main}() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\phpunit:36
PHP 3. PHPUnit_TextUI_Command->run() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:104
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\TextUI\Command.php:126
PHP 5. ReflectionMethod->invoke() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
PHP 6. NetBeansSuite::suite() C:\WebServer\Apache 2.2\htdocs\DataBaseTests\vendor\phpunit\phpunit\src\Runner\BaseTestRunner.php:89
ConcluĂdo.
I am using Composer.
I already installed the dependencies, pointed the phpunit executable on the bin folder in NetBeans configuration, and done all the same configuration from the project on my desktop that was working fine, but I still get this error.
EDIT:
The files in C:\WebServer\Apache 2.2\htdocs\DataBaseTests\tests are
C:\WebServer\Apache 2.2\htdocs\DataBaseTests\tests\Marco\Test\Manager\InvoiceManagerTest.php
C:\WebServer\Apache 2.2\htdocs\DataBaseTests\tests\Marco\Test\Manager\PDOMock.php
C:\WebServer\Apache 2.2\htdocs\DataBaseTests\tests\Marco\Test\Model\InvoiceTest.php
I found that the shell script version (bin/phpunit.sh) does not work with Netbeans. Choose libexec/phpunit.phar instead.
I encountered 2 problems. The first has the symptom of 'no tests found' and prints a similar error if you try the command:
"/usr/local/bin/php" "/usr/local/Cellar/phpunit/4.3.4/bin/phpunit" "--colors" "--log-junit" "/var/folders/vc/r2k02djd5gg664g0v7ggm8l40000gn/T/nb-phpunit-log.xml" "--bootstrap" "/Users/...bootstrap.php.cache" "--configuration" "/Users/.../app/phpunit.xml.dist" "/Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/php/phpunit/NetBeansSuite.php" "--run=/Users/...Tests/Controller/DefaultControllerTest.php"
This was fixed by using phpunit/4.3.4/libexec/phpunit.phar.
The second problem I encountered, but with a different symptom was in using phpunit 5.0.0. I used the phar version as above but it appears to have a bug https://github.com/sebastianbergmann/phpunit/issues/1887. It returns
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in phar:///usr/local/Cellar/phpunit/5.0.0/libexec/phpunit-5.0.0.phar/phar/phpunit-mock-objects/Framework/MockObject/Builder/InvocationMocker.php on line 82
Related
PrestaShop 1.6.1.20
PHP 5.6.37
Hi,
I tried to install a new module on my website but i end up with this php error that i don't know how to debug.
[29-Nov-2018 15:58:11 Europe/Paris] PHP Notice: Undefined index: prod in C:\wamp64\www\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 115
[29-Nov-2018 15:58:11 Europe/Paris] PHP Stack trace:
[29-Nov-2018 15:58:11 Europe/Paris] PHP 1. {main}() C:\wamp64\www\prestashop\index.php:0
[29-Nov-2018 15:58:11 Europe/Paris] PHP 2. DispatcherCore->dispatch() C:\wamp64\www\prestashop\index.php:28
[29-Nov-2018 15:58:11 Europe/Paris] PHP 3. ControllerCore->run() C:\wamp64\www\prestashop\classes\Dispatcher.php:367
[29-Nov-2018 15:58:11 Europe/Paris] PHP 4. IndexControllerCore->initContent() C:\wamp64\www\prestashop\classes\controller\Controller.php:189
[29-Nov-2018 15:58:11 Europe/Paris] PHP 5. HookCore::exec() C:\wamp64\www\prestashop\controllers\front\IndexController.php:40
[29-Nov-2018 15:58:11 Europe/Paris] PHP 6. HookCore::coreCallHook() C:\wamp64\www\prestashop\classes\Hook.php:548
[29-Nov-2018 15:58:11 Europe/Paris] PHP 7. HomecategoriesPlus->hookHome() C:\wamp64\www\prestashop\classes\Hook.php:591
[29-Nov-2018 15:58:11 Europe/Paris] PHP 8. ModuleCore->display() C:\wamp64\www\prestashop\modules\homecategoriesplus\homecategoriesplus.php:767
[29-Nov-2018 15:58:11 Europe/Paris] PHP 9. Smarty_Custom_Template->fetch() C:\wamp64\www\prestashop\classes\module\Module.php:2309
[29-Nov-2018 15:58:11 Europe/Paris] PHP 10. Smarty_Internal_TemplateBase->fetch() C:\wamp64\www\prestashop\classes\SmartyCustom.php:308
[29-Nov-2018 15:58:11 Europe/Paris] PHP 11. content_5bfffe83b6f704_96197512() C:\wamp64\www\prestashop\tools\smarty\sysplugins\smarty_internal_templatebase.php:188
I've tried to look for 'prod' in smarty_internal_templatebase.php but i didn't found anything. would anyone have an idea about where to look and how to fix this ?
Look at the module homecategoriesplus.php at line 767. Your debug says this. I think you just need to add a condition in your homecategoriesplus.tpl to check if the variable prod exists. Something like
{if isset($prod) && $prod}
/*your code here*/
{/if}
or just set default value to the variable during creating it in the homecategoriesplus.php
I have a backend system based on Symfony 3.x, and I work on PHPStorm 2017.x.
My Server is a regular XAMPP 5.6.8 stack with Apache and MySQL only, and I applied the latest compatible phpunit.phar (5.7.20) to the "php"-folder in the XAMPP-directory. I am supposed to run PHPUnit tests with a Phing buildfile, however the internal PHPStorm terminal displays an error:
Fatal error: Class 'PHPUnit\Framework\TestCase' not found in O:\%PROJECT_DIR%\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php on line 25
In my current project settings, I pointed to the phpunit.phar within my XAMPP-directory, but somehow it still tries to find the phpunit within the Symfony vendor directory. Where exactly is the source of the error and how can I correct it? Is it Phing-based?
EDIT:
Adding the error call stack:
Call Stack:
0.0003 121616 1. {main}() O:\xampp_5_6_8\php\phpunit:0
0.0064 357360 2. PHPUnit_TextUI_Command::main() O:\xampp_5_6_8\php\phpunit:46
0.0064 360760 3. PHPUnit_TextUI_Command->run() O:\xampp_5_6_8\php\pear\PHPUnit\TextUI\Command.php:129
0.0064 361968 4. PHPUnit_TextUI_Command->handleArguments() O:\xampp_5_6_8\php\pear\PHPUnit\TextUI\Command.php:138
0.0212 833056 5. PHPUnit_Util_Configuration->getTestSuiteConfiguration() O:\xampp_5_6_8\php\pear\PHPUnit\TextUI\Command.php:657
0.0212 833720 6. PHPUnit_Util_Configuration->getTestSuite() O:\xampp_5_6_8\php\pear\PHPUnit\Util\Configuration.php:789
0.0609 976960 7. PHPUnit_Framework_TestSuite->addTestFiles() O:\xampp_5_6_8\php\pear\PHPUnit\Util\Configuration.php:873
0.0609 978088 8. PHPUnit_Framework_TestSuite->addTestFile() O:\xampp_5_6_8\php\pear\PHPUnit\Framework\TestSuite.php:416
0.0623 1033248 9. PHPUnit_Util_Fileloader::checkAndLoad() O:\xampp_5_6_8\php\pear\PHPUnit\Framework\TestSuite.php:355
0.0634 1033416 10. PHPUnit_Util_Fileloader::load() O:\xampp_5_6_8\php\pear\PHPUnit\Util\Fileloader.php:76
0.0642 1054496 11. include_once('O:\%PROJECT_DIR%\src\App\Bundle\Tests\Controller\ControllerTest.php') O:\xampp_5_6_8\php\pear\PHPUnit\Util\Fileloader.php:92
0.0643 1054728 12. spl_autoload_call() O:\xampp_5_6_8\php\pear\PHPUnit\Util\Fileloader.php:11
0.0643 1054784 13. Composer\Autoload\ClassLoader->loadClass() O:\xampp_5_6_8\php\pear\PHPUnit\Util\Fileloader.php:0
0.0647 1054960 14. Composer\Autoload\includeFile() O:\%PROJECT_DIR%\vendor\composer\ClassLoader.php:301
0.0653 1059352 15. include('O:\%PROJECT_DIR%\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\WebTestCase.php') O:\%PROJECT_DIR%\vendor\composer\ClassLoader.php:414
0.0653 1059592 16. spl_autoload_call() O:\%PROJECT_DIR%\vendor\composer\ClassLoader.php:22
0.0653 1059656 17. Composer\Autoload\ClassLoader->loadClass() O:\%PROJECT_DIR%\vendor\composer\ClassLoader.php:0
0.0657 1059832 18. Composer\Autoload\includeFile() O:\%PROJECT_DIR%\vendor\composer\ClassLoader.php:301
0.0664 1091728 19. include('O:\%PROJECT_DIR%\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php') O:\%PROJECT_DIR%\vendor\composer\ClassLoader.php:414
PHPUnit\Framework\TestCase is a reference to PhpUnit 6 test version while you're using phpunit.phar (5.7.20).
Try to replace it with the latest 6.* version.
I am really new to PHPUnit testing, so I will have a lot of question about it later, but first, go step by step.
I'v tried to follow the following this tutorial from netbeans site.
Unluckily, the documentation is a littlebit outdated, and not so precise I think.
I am using Netbeans 8.0.2 on Win7 Ultimate 64bit
So, I've created a new project, and under that a Calculator.php and copied the code from the tutorial.
Then I right click on that, say, Tools -> Create Tests. In my test directory, the skeleton generator creates the CalculatorTest.
Documentation forgot to mention to create a boostrap to include the Calculator.php for the test, but don't get stuck on it, I did it.
Now, I am right click on the Calculator.php and says, Test. The result is not that what I am expected.
The test results window says: No test executed, while the on the right:
Perhaps error occurred, verify in Output window.
Sorry for this big bunch of code, I've just want to be sure, you are see what I do, so here is the content of the output window (see below).
What do I am doing wrong, how can I solve this problem?
"D:\PHP\php.exe" "D:\bin\phpunit.phar" "--colors" "--log-junit" "C:\Users\Lenovo\AppData\Local\Temp\nb-phpunit-log.xml" "--bootstrap" "D:\Apache\htdocs\unittest\test\bootstrap.php" "C:\Users\Lenovo\AppData\Roaming\NetBeans\8.0\phpunit\NetBeansSuite.php" "--run=D:\Apache\htdocs\unittest\test\CalculatorTest.php"
PHPUnit 4.4.2 by Sebastian Bergmann.
....PHP SebastianBergmann\Comparator\ComparisonFailure: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/sebastian-comparator/NumericComparator.php on line 99
PHP Stack trace:
PHP 1. {main}() D:\bin\phpunit.phar:0
PHP 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
PHP 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
PHP 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
PHP 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
PHP 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
PHP 10. PHPUnit_Framework_TestCase->runTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:731
PHP 11. ReflectionMethod->invokeArgs() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
PHP 12. CalculatorTest->testAdd5() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
PHP 13. PHPUnit_Framework_Assert::assertEquals() D:\Apache\htdocs\unittest\test\CalculatorTest.php:81
PHP 14. PHPUnit_Framework_Assert::assertThat() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:490
PHP 15. PHPUnit_Framework_Constraint_IsEqual->evaluate() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:2214
PHP 16. SebastianBergmann\Comparator\NumericComparator->assertEquals() phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php:129
PHP PHPUnit_Framework_ExpectationFailedException: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php on line 135
PHP Stack trace:
PHP 1. {main}() D:\bin\phpunit.phar:0
PHP 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
PHP 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
PHP 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
PHP 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
PHP 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
PHP 10. PHPUnit_Framework_TestCase->runTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:731
PHP 11. ReflectionMethod->invokeArgs() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
PHP 12. CalculatorTest->testAdd5() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
PHP 13. PHPUnit_Framework_Assert::assertEquals() D:\Apache\htdocs\unittest\test\CalculatorTest.php:81
PHP 14. PHPUnit_Framework_Assert::assertThat() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:490
PHP 15. PHPUnit_Framework_Constraint_IsEqual->evaluate() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:2214
PHP PHPUnit_Framework_ExpectationFailedException: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php on line 135
PHP Stack trace:
PHP 1. {main}() D:\bin\phpunit.phar:0
PHP 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
PHP 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
PHP 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
PHPUnit_Framework_ExpectationFailedException: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php on line 135
Call Stack:
0.0300 384472 1. {main}() D:\bin\phpunit.phar:0
0.0340 589312 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
0.0340 592992 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
0.3690 1760968 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
0.3860 2057496 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
0.4100 2068840 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8230 2443240 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8250 2443208 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
0.8290 2443952 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
0.8941 2538768 10. PHPUnit_Framework_TestCase->onNotSuccessfulTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:816
F
SebastianBergmann\Comparator\ComparisonFailure: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/sebastian-comparator/NumericComparator.php on line 99
Call Stack:
0.0300 384472 1. {main}() D:\bin\phpunit.phar:0
0.0340 589312 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
0.0340 592992 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
0.3690 1760968 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
0.3860 2057496 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
0.4100 2068840 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8230 2443240 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8250 2443208 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
0.8290 2443952 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
0.8550 2474128 10. PHPUnit_Framework_TestCase->runTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:731
0.8550 2474600 11. ReflectionMethod->invokeArgs() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
0.8550 2474616 12. CalculatorTest->testAdd5() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
0.8560 2474712 13. PHPUnit_Framework_Assert::assertEquals() D:\Apache\htdocs\unittest\test\CalculatorTest.php:81
0.8560 2475072 14. PHPUnit_Framework_Assert::assertThat() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:490
0.8570 2475072 15. PHPUnit_Framework_Constraint_IsEqual->evaluate() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:2214
0.8661 2477440 16. SebastianBergmann\Comparator\NumericComparator->assertEquals() phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php:129
PHPUnit_Framework_ExpectationFailedException: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php on line 135
Call Stack:
0.0300 384472 1. {main}() D:\bin\phpunit.phar:0
0.0340 589312 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
0.0340 592992 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
0.3690 1760968 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
0.3860 2057496 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
0.4100 2068840 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8230 2443240 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8250 2443208 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
0.8290 2443952 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
0.8550 2474128 10. PHPUnit_Framework_TestCase->runTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:731
0.8550 2474600 11. ReflectionMethod->invokeArgs() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
0.8550 2474616 12. CalculatorTest->testAdd5() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:846
0.8560 2474712 13. PHPUnit_Framework_Assert::assertEquals() D:\Apache\htdocs\unittest\test\CalculatorTest.php:81
0.8560 2475072 14. PHPUnit_Framework_Assert::assertThat() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:490
0.8570 2475072 15. PHPUnit_Framework_Constraint_IsEqual->evaluate() phar://D:/bin/phpunit.phar/phpunit/Framework/Assert.php:2214
PHPUnit_Framework_ExpectationFailedException: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php on line 135
Call Stack:
0.0300 384472 1. {main}() D:\bin\phpunit.phar:0
0.0340 589312 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
0.0340 592992 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
0.3690 1760968 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
0.3860 2057496 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
0.4100 2068840 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8230 2443240 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
0.8250 2443208 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
0.8290 2443952 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
0.8550 2474128 10. PHPUnit_Framework_TestCase->runTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:731
Time: 1 second, Memory: 4.00Mb
There was 1 failure:
1) CalculatorTest::testAdd5
Failed asserting that 3 matches expected 4.
D:\Apache\htdocs\unittest\test\CalculatorTest.php:81
FAILURES!
Tests: 5, Assertions: 5, Failures: 1.
PHP 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
PHP 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
PHP 10. PHPUnit_Framework_TestCase->runTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:731
PHP PHPUnit_Framework_ExpectationFailedException: Failed asserting that 3 matches expected 4. in phar://D:/bin/phpunit.phar/phpunit/Framework/Constraint/IsEqual.php on line 135
PHP Stack trace:
PHP 1. {main}() D:\bin\phpunit.phar:0
PHP 2. PHPUnit_TextUI_Command::main() D:\bin\phpunit.phar:619
PHP 3. PHPUnit_TextUI_Command->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:103
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar://D:/bin/phpunit.phar/phpunit/TextUI/Command.php:151
PHP 5. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/TextUI/TestRunner.php:388
PHP 6. PHPUnit_Framework_TestSuite->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 7. PHPUnit_Framework_TestCase->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestSuite.php:716
PHP 8. PHPUnit_Framework_TestResult->run() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:687
PHP 9. PHPUnit_Framework_TestCase->runBare() phar://D:/bin/phpunit.phar/phpunit/Framework/TestResult.php:609
PHP 10. PHPUnit_Framework_TestCase->onNotSuccessfulTest() phar://D:/bin/phpunit.phar/phpunit/Framework/TestCase.php:816
Done.
I'm currently reading the "Easy PHP Websites with the Zend Framework". At some point, it introduces Doctrine and gives a src code along with an text on how to install stuff properly.
I've followed all the steps correctly, but in one you have to use a "seed.php" which reads some ASINs and loads some amazon product details into the databass.
However, executing the script gives me errors, and it seems like it can't locate a file.
PHP Warning: include_once(WJG\Controller\Action\Helper\Initializer.php): failed to
open stream: No such file or directory in
C:\Programming\zend\library\Zend\L oader.php on line 134 PHP Stack
trace: PHP
1. {main}() C:\wamp\www\webclass\application\scripts\seed.php:0 PHP
2. include() C:\wamp\www\webclass\application\scripts\seed.php:9 PHP
3. Zend_Application->bootstrap() C:\wamp\www\webclass\public\cli.php:20
4. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap() C:\Programmin g\zend\library\Zend\Application.php:355 PHP
5. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap()
C:\Programmi
ng\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:586
PHP
6.Zend_Application_Bootstrap_BootstrapAbstract->_executeResource()
C:\Pro
gramming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:622
PHP
7. Bootstrap->_initGlobalVars() C:\Programming\zend\library\Zend\Applicati
on\Bootstrap\BootstrapAbstract.php:669 PHP
8.Zend_Loader_Autoloader::autoload()
C:\Programming\zend\library\Zend\App
lication\Bootstrap\BootstrapAbstract.php:0 PHP
9. call_user_func() C:\Programming\zend\library\Zend\Loader\Autoloader.php :124 PHP
10.Zend_Loader_Autoloader->_autoload()
C:\Programming\zend\library\Zend\Lo ader\Autoloader.php:124 PHP
11. call_user_func()
C:\Programming\zend\library\Zend\Loader\Autoloader.php :479 PHP
12. Zend_Loader::loadClass()
C:\Programming\zend\library\Zend\Loader\Autolo ader.php:479 PHP
13. Zend_Loader::loadFile() C:\Programming\zend\library\Zend\Loader.php:82
Warning: include_once(WJG\Controller\Action\Helper\Initializer.php):
failed to o pen stream: No such file or directory in
C:\Programming\zend\library\Zend\Loader .php on line 134
Call Stack:
0.0004 651544 1. {main}() C:\wamp\www\webclass\application\scripts\see d.php:0
0.0006 661568 2. include('C:\wamp\www\webclass\public\cli.php') C:\wam
p\www\webclass\application\scripts\seed.php:9
0.0121 2052384 3. Zend_Application->bootstrap() C:\wamp\www\webclass\pu blic\cli.php:20
0.0121 2052432 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstr ap()
C:\Programming\zend\library\Zend\Application.php:355
0.0121 2052432 5. Zend_Application_Bootstrap_BootstrapAbstract->_bootst rap()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.p
hp:586
0.0190 3235544 6. Zend_Application_Bootstrap_BootstrapAbstract->_execut eResource()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbst
ract.php:622
0.0190 3235768 7. Bootstrap->_initGlobalVars() C:\Programming\zend\libr
ary\Zend\Application\Bootstrap\BootstrapAbstract.php:669
0.0190 3236432 8. Zend_Loader_Autoloader::autoload() C:\Programming\zen
d\library\Zend\Application\Bootstrap\BootstrapAbstract.php:0
0.0191 3236768 9. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:124
0.0191 3236800 10. Zend_Loader_Autoloader->_autoload() C:\Programming\ze nd\library\Zend\Loader\Autoloader.php:124
0.0191 3236848 11. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:479
0.0191 3236880 12. Zend_Loader::loadClass() C:\Programming\zend\library\ Zend\Loader\Autoloader.php:479
0.0191 3237136 13. Zend_Loader::loadFile() C:\Programming\zend\library\Z end\Loader.php:82
PHP Warning: include_once(): Failed opening
'WJG\Controller\Action\Helper\Initi alizer.php' for inclusion
(include_path='C:\wamp\www\webclass\application/../vie
ws;.;C:\wamp\bin\php\php5.3.13\pear;c:\php\includes;C:\Programming\zend\library;
C:\wamp\bin\php\php5.3.13\pear\PEAR') in
C:\Programming\zend\library\Zend\Loader .php on line 134 PHP Stack
trace: PHP 1. {main}()
C:\wamp\www\webclass\application\scripts\seed.php:0 PHP 2. include()
C:\wamp\www\webclass\application\scripts\seed.php:9 PHP 3.
Zend_Application->bootstrap() C:\wamp\www\webclass\public\cli.php:20
PHP 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap()
C:\Programmin g\zend\library\Zend\Application.php:355 PHP 5.
Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap()
C:\Programmi
ng\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:586
PHP 6.
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource()
C:\Pro
gramming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:622
PHP 7. Bootstrap->_initGlobalVars()
C:\Programming\zend\library\Zend\Applicati
on\Bootstrap\BootstrapAbstract.php:669 PHP 8.
Zend_Loader_Autoloader::autoload()
C:\Programming\zend\library\Zend\App
lication\Bootstrap\BootstrapAbstract.php:0 PHP 9. call_user_func()
C:\Programming\zend\library\Zend\Loader\Autoloader.php :124 PHP 10.
Zend_Loader_Autoloader->_autoload()
C:\Programming\zend\library\Zend\Lo ader\Autoloader.php:124 PHP 11.
call_user_func()
C:\Programming\zend\library\Zend\Loader\Autoloader.php :479 PHP 12.
Zend_Loader::loadClass()
C:\Programming\zend\library\Zend\Loader\Autolo ader.php:479 PHP 13.
Zend_Loader::loadFile() C:\Programming\zend\library\Zend\Loader.php:82
Warning: include_once(): Failed opening
'WJG\Controller\Action\Helper\Initialize r.php' for inclusion
(include_path='C:\wamp\www\webclass\application/../views;.;
C:\wamp\bin\php\php5.3.13\pear;c:\php\includes;C:\Programming\zend\library;C:\wa
mp\bin\php\php5.3.13\pear\PEAR') in
C:\Programming\zend\library\Zend\Loader.php on line 134
Call Stack:
0.0004 651544 1. {main}() C:\wamp\www\webclass\application\scripts\see d.php:0
0.0006 661568 2. include('C:\wamp\www\webclass\public\cli.php') C:\wam
p\www\webclass\application\scripts\seed.php:9
0.0121 2052384 3. Zend_Application->bootstrap() C:\wamp\www\webclass\pu blic\cli.php:20
0.0121 2052432 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstr ap()
C:\Programming\zend\library\Zend\Application.php:355
0.0121 2052432 5. Zend_Application_Bootstrap_BootstrapAbstract->_bootst rap()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.p
hp:586
0.0190 3235544 6. Zend_Application_Bootstrap_BootstrapAbstract->_execut eResource()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbst
ract.php:622
0.0190 3235768 7. Bootstrap->_initGlobalVars() C:\Programming\zend\libr
ary\Zend\Application\Bootstrap\BootstrapAbstract.php:669
0.0190 3236432 8. Zend_Loader_Autoloader::autoload() C:\Programming\zen
d\library\Zend\Application\Bootstrap\BootstrapAbstract.php:0
0.0191 3236768 9. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:124
0.0191 3236800 10. Zend_Loader_Autoloader->_autoload() C:\Programming\ze nd\library\Zend\Loader\Autoloader.php:124
0.0191 3236848 11. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:479
0.0191 3236880 12. Zend_Loader::loadClass() C:\Programming\zend\library\ Zend\Loader\Autoloader.php:479
0.0191 3237136 13. Zend_Loader::loadFile() C:\Programming\zend\library\Z end\Loader.php:82
PHP Fatal error: Class 'WJG_Controller_Action_Helper_Initializer' not
found in C:\wamp\www\webclass\application\Bootstrap.php on line 39 PHP
Stack trace: PHP 1. {main}()
C:\wamp\www\webclass\application\scripts\seed.php:0 PHP 2. include()
C:\wamp\www\webclass\application\scripts\seed.php:9 PHP 3.
Zend_Application->bootstrap() C:\wamp\www\webclass\public\cli.php:20
PHP 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap()
C:\Programmin g\zend\library\Zend\Application.php:355 PHP 5.
Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap()
C:\Programmi
ng\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:586
PHP 6.
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource()
C:\Pro
gramming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:622
PHP 7. Bootstrap->_initGlobalVars()
C:\Programming\zend\library\Zend\Applicati
on\Bootstrap\BootstrapAbstract.php:669
Fatal error: Class 'WJG_Controller_Action_Helper_Initializer' not
found in C:\wa mp\www\webclass\application\Bootstrap.php on line 39
Call Stack:
0.0004 651544 1. {main}() C:\wamp\www\webclass\application\scripts\see d.php:0
0.0006 661568 2. include('C:\wamp\www\webclass\public\cli.php') C:\wam
p\www\webclass\application\scripts\seed.php:9
0.0121 2052384 3. Zend_Application->bootstrap() C:\wamp\www\webclass\pu blic\cli.php:20
0.0121 2052432 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstr ap()
C:\Programming\zend\library\Zend\Application.php:355
0.0121 2052432 5. Zend_Application_Bootstrap_BootstrapAbstract->_bootst rap()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.p
hp:586
0.0190 3235544 6. Zend_Application_Bootstrap_BootstrapAbstract->_execut eResource()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbst
ract.php:622
0.0190 3235768 7. Bootstrap->_initGlobalVars() C:\Programming\zend\libr
ary\Zend\Application\Bootstrap\BootstrapAbstract.php:669
This is the error, and here is the _initGlobalVars()
protected function _initGlobalVars()
{
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/../library/WJG/Controller/Action/Helper');
$initializer = Zend_Controller_Action_HelperBroker::addHelper(
new WJG_Controller_Action_Helper_Initializer());
}
If you want some more info ask me, please help me because I really want to continue with the flow of the book, thanks!
You need to add prefix to the path:
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/../library/WJG/Controller/Action/Helper');
add then:
Zend_Controller_Action_HelperBroker::addPrefix("WJG_Controller_Action_Helper_");
Hope this helps :)
I am trying to get phpunit 3.5 working. But everytime i run my tests i get this error:
PHP Fatal error: Class 'PHPUnit_Framework_TestFailure' not found in C:\wamp\bin
\php\php5.3.9\pear\PHPUnit\Framework\TestResult.php on line 266
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.9\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.9\phpunit:49
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.9\pear\PHPUnit\Tex
tUI\Command.php:129
PHP 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.9\pear\PHPUni
t\TextUI\Command.php:188
PHP 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.9\pear\PHPUni
t\TextUI\TestRunner.php:305
PHP 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.9\pear\PHPUni
t\Framework\TestSuite.php:693
PHP 7. PHPUnit_Framework_TestSuite->runTest() C:\wamp\bin\php\php5.3.9\pear\PH
PUnit\Framework\TestSuite.php:733
PHP 8. PHPUnit_Framework_TestCase->run() C:\wamp\bin\php\php5.3.9\pear\PHPUnit
\Framework\TestSuite.php:757
PHP 9. PHPUnit_Framework_TestResult->run() C:\wamp\bin\php\php5.3.9\pear\PHPUn
it\Framework\TestCase.php:576
PHP 10. PHPUnit_Framework_TestResult->addError() C:\wamp\bin\php\php5.3.9\pear\
PHPUnit\Framework\TestResult.php:717
Fatal error: Class 'PHPUnit_Framework_TestFailure' not found in C:\wamp\bin\php\
php5.3.9\pear\PHPUnit\Framework\TestResult.php on line 266
Call Stack:
0.0004 327336 1. {main}() C:\wamp\bin\php\php5.3.9\phpunit:0
0.3024 699040 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3
.9\phpunit:49
0.3024 699392 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.
9\pear\PHPUnit\TextUI\Command.php:129
0.3929 3300128 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\ph
p5.3.9\pear\PHPUnit\TextUI\Command.php:188
0.4153 3766872 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\ph
p5.3.9\pear\PHPUnit\TextUI\TestRunner.php:305
0.4154 3767136 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\ph
p5.3.9\pear\PHPUnit\Framework\TestSuite.php:693
0.4155 3767336 7. PHPUnit_Framework_TestSuite->runTest() C:\wamp\bin\ph
p\php5.3.9\pear\PHPUnit\Framework\TestSuite.php:733
0.4155 3767336 8. PHPUnit_Framework_TestCase->run() C:\wamp\bin\php\php
5.3.9\pear\PHPUnit\Framework\TestSuite.php:757
0.4158 3767336 9. PHPUnit_Framework_TestResult->run() C:\wamp\bin\php\p
hp5.3.9\pear\PHPUnit\Framework\TestCase.php:576
0.4257 3934600 10. PHPUnit_Framework_TestResult->addError() C:\wamp\bin\
php\php5.3.9\pear\PHPUnit\Framework\TestResult.php:717
c:\wamp\www\ZendSkeletonApplication\module\page\test>
And this is my include path:
string(252) "C:\wamp\bin\php\php5.3.9\pear\PHPUnit\Autoload.php;C:\wamp\www\Zend
SkeletonApplication\module\page/test;C:\wamp\www\ZendSkeletonApplication\vendor\
ZendFramework\library;.;C:\wamp\bin\php\php5.3.9\pear;C:\pear\pear;C:\pear\pear;
C:\pear\pear;C:\pear\pear"
The file TestFailure doe exist.
So any idea's?
You should include the full PHPUNit directory in your path and you also must manually include the autoloader. So at the top of your php file, add this:
require 'PHPUnit/Autoload.php'
And in your include path, change the PHPUnit part to just C:\wamp\bin\php\php5.3.9\pear\PHPUnit (instead of what you currently have, C:\wamp\bin\php\php5.3.9\pear\PHPUnit\Autoload.php).
Try loading it manually, seems like this old version is buggy
require_once 'PHPUnit/Framework/TestFailure.php';