Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Test Bootstrap don't work #25

Open
seyfer opened this issue May 25, 2014 · 1 comment
Open

Test Bootstrap don't work #25

seyfer opened this issue May 25, 2014 · 1 comment

Comments

@seyfer
Copy link

seyfer commented May 25, 2014

Bootstrap don't work.
Linked to this issue
#19

if i run it

./vendor/bin/phpunit  --bootstrap=./module/Users/tests/bootstrap.php module/Users/tests/
PHP Fatal error:  Class 'UsersTest\Framework\TestCase' not found in /home/seyfer/www/zend2-tutorial.me/module/Users/tests/Users/SampleTest.php on line 18

Now i need include file by myself in SampleTest.php
require_once 'Framework/TestCase.php';

Ok, now it runs, but assert fails

1) UsersTest\SampleTest::testSample
Failed asserting that null is an instance of interface "Zend\Di\LocatorInterface".

/home/seyfer/www/zend2-tutorial.me/module/Users/tests/Users/SampleTest.php:22

FAILURES!                            
Tests: 1, Assertions: 1, Failures: 1.

If i run it from module tests/ folder - same errors.

So, bootstrap by default don't work like it need to work.
And after installing this ZendSkeletonModule users need to change Bootstrap for testing to something like:
https://github.com/phly/PhlySimplePage/blob/master/test/Bootstrap.php
or
https://github.com/EvanDotPro/SpeckCart/blob/master/tests/Bootstrap.php

Why not include working Bootstrap.php by default?

Like framework user, i want working solution after install SkeletonModule and just add my Test classes and run it with configuration by default.

@aaronjameslang
Copy link

I second this strongly.

As someone new to PHP trying to learn ZF2, having the sample applications not work is very frustrating.

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

No branches or pull requests

2 participants