public function testAddGrantTypeWithKeyNotString() { $server = new Server(); $server->addGrantType(new \OAuth2\GrantType\AuthorizationCode($this->getMock('OAuth2\\Storage\\AuthorizationCodeInterface')), 42); $grantTypes = $server->getGrantTypes(); $this->assertEquals('authorization_code', key($grantTypes)); }