Happyr\LinkedIn\AuthenticatorTest::testGetCodeUsedCode PHP Метод

testGetCodeUsedCode() публичный Метод

public testGetCodeUsedCode ( )
    public function testGetCodeUsedCode()
    {
        $method = new \ReflectionMethod('Happyr\\LinkedIn\\Authenticator', 'getCode');
        $method->setAccessible(true);
        $storage = m::mock('Happyr\\LinkedIn\\Storage\\DataStorageInterface')->shouldReceive('get')->once()->with('code')->andReturn('foobar')->getMock();
        $auth = $this->getMock('Happyr\\LinkedIn\\Authenticator', ['getStorage'], [], '', false);
        $auth->expects($this->once())->method('getStorage')->will($this->returnValue($storage));
        $_REQUEST['code'] = 'foobar';
        $this->assertEquals(null, $method->invoke($auth));
    }