Silex\WebTestCase giving Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0 -
here test class
class campaigncontrollertest extends webtestcase { public function createapplication() { $app = commonfunction::getapplication(); $app['debug'] = true; $app['exception_handler']->disable(); $app['session.storage'] = $app->share(function() { return new mockarraysessionstorage(); }); $app['session.test'] = true; return $app; } public function testinitialpage() { $client = $this->createclient(); $crawler = $client->request('get', '/'); $this->assertequals(1,1); } }
when phpunit getting error, idea how fix ?
there 1 error: 1) campaigncontrollertest::testinitialpage symfony\component\security\core\securitycontext class deprecated since version 2.6 , removed in 3.0. use symfony\component\security\core\authentication\token\storage\tokenstorage or symfony\component\security\core\authorization\authorizationchecker instead. /home/ariful1/imoney/formapply/vendor/symfony/security/core/securitycontext.php:14 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/provider/securityserviceprovider.php:76 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:126 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:83 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/provider/securityserviceprovider.php:327 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:126 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:83 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/provider/securityserviceprovider.php:252 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/provider/securityserviceprovider.php:264 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:126 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:83 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/provider/securityserviceprovider.php:113 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:126 /home/ariful1/imoney/formapply/vendor/pimple/pimple/lib/pimple.php:83 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/provider/securityserviceprovider.php:540 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/application.php:188 /home/ariful1/imoney/formapply/vendor/silex/silex/src/silex/application.php:538 /home/ariful1/imoney/formapply/vendor/symfony/http-kernel/symfony/component/httpkernel/client.php:81 /home/ariful1/imoney/formapply/vendor/symfony/browser-kit/client.php:327 /home/ariful1/imoney/formapply/tests/formapply/test/controller/campaigncontrollertest.php:26
i using silex 1.2.x , phpunit 4.3.* .
this issue popped-up in symfony framework last year. final solution bootstrap new error handler captures deprecation errors when running tests. adopt same solution or otherwise configure error reporting while testing ignore e_user_deprecated
errors.
Comments
Post a Comment