sdiaz / FOSRestBundleByExample

FOSRestBundle example project with Symfony 2.6 standard distribution
MIT License
106 stars 31 forks source link

cannot get unittests to pass #7

Closed bassim closed 9 years ago

bassim commented 11 years ago

After Trying to get your code working in an existing sf2.2 application without much success, I tried to get this bundle to work on its own. After a 'git clone' and 'ant installdeps' this is the output of 'ant phpunit':


Bass-MacBook-Pro:FOSRestBundleByExample bassimons$ ant phpunit Buildfile: /Users/bassimons/Projects/FOSRestBundleByExample/build.xml

validate: [exec] Dropped database for connection named fosrestbyexample [exec] Created database for connection named fosrestbyexample [exec] ATTENTION: This operation should not be executed in a production environment. [exec] [exec] Creating database schema... [exec] Database schema created successfully! [exec] Nothing to update - your database is already in sync with the current entity metadata. [exec] Created user admin [exec] User "admin" has been activated. [exec] Role "ROLE_DEVELOPER" has been added to user "admin". [exec] Clearing the cache for the dev environment with debug true

phpunit: [exec] PHPUnit 3.7.10 by Sebastian Bergmann. [exec] [exec] Configuration read from /Users/bassimons/Projects/FOSRestBundleByExample/app/phpunit.xml [exec] [exec] FFF.......F............ [exec] [exec] Time: 36 seconds, Memory: 108.50Mb [exec] [exec] There were 4 failures: [exec] [exec] 1) ByExample\DemoBundle\Tests\Controller\SecurityControllerTest::testPostLoginAction [exec] Failed asserting that 404 matches expected 200. [exec] [exec] /Users/bassimons/Projects/FOSRestBundleByExample/src/ByExample/DemoBundle/Tests/Controller/SecurityControllerTest.php:86 [exec] [exec] 2) ByExample\DemoBundle\Tests\Controller\SecurityControllerTest::testPostLoginAction_invalid_user [exec] Failed asserting that 404 matches expected 500. [exec] [exec] /Users/bassimons/Projects/FOSRestBundleByExample/src/ByExample/DemoBundle/Tests/Controller/SecurityControllerTest.php:105 [exec] [exec] 3) ByExample\DemoBundle\Tests\Controller\SecurityControllerTest::testLogout [exec] Failed asserting that 404 matches expected 200. [exec] [exec] /Users/bassimons/Projects/FOSRestBundleByExample/src/ByExample/DemoBundle/Tests/Controller/SecurityControllerTest.php:120 [exec] [exec] 4) ByExample\DemoBundle\Tests\Controller\UserRestControllerTest::testDeleteUserAction_without_slug [exec] Failed asserting that exception of type "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException" is thrown. [exec] [exec] FAILURES! Tests: 23, Assertions: 47, Failures: 4.


Any thoughts on this? How does the application match for example '/security/tokens/creates' on an action? and which should it be? SecurityController.postTokenCreateAction()?

notprathap commented 11 years ago

its /security/token/create - please remove "s"

sdiaz commented 9 years ago

I updated the bundle, i will create the controllers test in the following days