assertEquals(40, strlen($v1)); $this->assertTrue($v1 !== $v2); $this->assertEquals(50, strlen($v3)); } public function testGenerateWithDifferentAlgorithm() { $algorithm = $this->getMock('League\OAuth2\Server\Util\KeyAlgorithm\KeyAlgorithmInterface'); $result = 'dasdsdsaads'; $algorithm ->expects($this->once()) ->method('generate') ->with(11) ->will($this->returnValue($result)) ; SecureKey::setAlgorithm($algorithm); $this->assertSame($algorithm, SecureKey::getAlgorithm()); $this->assertEquals($result, SecureKey::generate(11)); } }