vendor/bshaffer/oauth2-server-bundle/OAuth2/ServerBundle/Tests/Entity/AuthorizationCodeTest.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace OAuth2\ServerBundle\Tests\Entity;
use OAuth2\ServerBundle\Tests\ContainerLoader;
use OAuth2\ServerBundle\Entity\AuthorizationCode;
class AuthorizationCodeTest extends \PHPUnit_Framework_TestCase
{
public function testCreate()
{
$container = ContainerLoader::buildTestContainer();
$em = $container->get('doctrine.orm.entity_manager');
$authcode = new AuthorizationCode();
$authcode->setCode($code = 'test-code-'.rand());
$authcode->setExpires(new \DateTime('+10 minutes')); // ten minutes from now
$authcode->setRedirectUri('http://brentertainment.com');
$em->persist($authcode);
$em->flush();
$stored = $em->find('OAuth2\ServerBundle\Entity\AuthorizationCode', array('code' => $code));
$this->assertNotNull($stored);
$this->assertEquals($code, $stored->getCode());
$this->assertEquals($authcode->getExpires(), $stored->getExpires());
$this->assertEquals($authcode->getRedirectUri(), $stored->getRedirectUri());
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。