tests/unit/Subjects/AbstractSubjectTest.php
/**
     * Test the raise counter method.
     *
     * @return void
     */
Test the raise counter method.
@return void
Test the raise counter method . @return void
public function testRaiseCounter()
    {
        $this->abstractSubject
             ->getRegistryProcessor()
             ->expects($this->once())
             ->method('raiseCounter')
             ->with(RegistryKeys::COUNTERS, $counterName = 'testCounter')
             ->willReturn($newCounterValue = 1);
        $this->abstractSubject->setSerial($this->serial);
        $this->assertSame($newCounterValue, $this->abstractSubject->raiseCounter($counterName));
    }
public function testRaiseCounter ( ) { $ this -> abstractSubject -> getRegistryProcessor ( ) -> expects ( $ this -> once ( ) ) -> method ( 'raiseCounter' ) -> with ( RegistryKeys :: COUNTERS , $ counterName = 'testCounter' ) -> willReturn ( $ newCounterValue = 1 ) ; $ this -> abstractSubject -> setSerial ( $ this -> serial ) ; $ this -> assertSame ( $ newCounterValue , $ this -> abstractSubject -> raiseCounter ( $ counterName ) ) ; }
Test the raise counter method.
Test the raise counter method .
// mock the registry processor raiseCounter() method // set the serial first // raise the counter and test the result