Home >


  • PHP mock method call in Controller phpspecFebruary 17

    I am trying to test a method within my controller with phpspec. This method should create a form by a form type class and render the response. The scenario is: The controller I am testing inherits the symfony controller, which offers me the method "c

  • PHPSpec should return correct valueJanuary 31

    I have problem with phpspec function - shouldReturn. I have factory whitch creating image object and I want to testing that factory. public function create($imageParams) { $image = new Image; $image->setName($imagesParams['name']); return $image; } p

  • How to create global custom matchers in PHPSpec?January 28

    I'm testing with PHPSpec, and I've got custom matchers in my spec files that I don't want to have to repeat in every file in which they're used. I want to be able to extend PHPSpec's behaviour and/or the behaviour of all my tests to use a global set

  • Testing PHPSpec symfony logged userJanuary 24

    I'am new in testing PHP with PHPSpec. I have a class where i inject symfony current logged user (TokenStorageInterface). And make changes with that user. <?php namespace AppBundle\Service; use AppBundle\Entity\Payment; use AppBundle\Entity\User; use

  • Testing objects that are usually generated by factories with phpspecJanuary 23

    How do you go about implementing tests that can leverage your factories to create your test objects? For example, imagine you have a Zend Framework 2 factory like so: class FooServiceFactory implements FactoryInterface{ public function createService(

  • How can I test the type of something generated in my phpspec test?January 21

    For example: Test code function it_records_last_checked() { $this->getWrappedObject()->setServiceLocator( $this->getServiceLocator() ); $this->isAvailable( 'google.com' )->shouldReturn( false ); /** @var Url $last */ $last = $this->getLa

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.330 s.