-
Notifications
You must be signed in to change notification settings - Fork 26
/
AccessTokenFixture.php
80 lines (71 loc) · 2.65 KB
/
AccessTokenFixture.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* This file is part of the authbucket/oauth2-symfony-bundle package.
*
* (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace AuthBucket\Bundle\OAuth2Bundle\Tests\TestBundle\DataFixtures\ORM;
use AuthBucket\Bundle\OAuth2Bundle\Tests\TestBundle\Entity\AccessToken;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
class AccessTokenFixture implements FixtureInterface
{
public function load(ObjectManager $manager)
{
$model = new AccessToken();
$model->setAccessToken('18cdaa6481c0d5f323351ea1029fc065')
->setTokenType('bearer')
->setClientId('6b44c21ef7bc8ca7380bb5b8276b3f97')
->setUsername('demousername1')
->setExpires(new \DateTime('+10 years'))
->setScope(array(
'demoscope1',
));
$manager->persist($model);
$model = new AccessToken();
$model->setAccessToken('eeb5aa92bbb4b56373b9e0d00bc02d93')
->setTokenType('bearer')
->setClientId('http://democlient1.com/')
->setUsername('demousername1')
->setExpires(new \DateTime('+10 years'))
->setScope(array(
'demoscope1',
));
$manager->persist($model);
$model = new AccessToken();
$model->setAccessToken('d2b58c4c6bc0cc9fefca2d558f1221a5')
->setTokenType('bearer')
->setClientId('http://democlient1.com/')
->setUsername('demousername1')
->setExpires(new \DateTime('-1 hours'))
->setScope(array(
'demoscope1',
));
$manager->persist($model);
$model = new AccessToken();
$model->setAccessToken('ba2e8d1f54ed3e3d96935796576f1a06')
->setTokenType('bearer')
->setClientId('http://democlient1.com/')
->setUsername('demousername1')
->setExpires(new \DateTime('+1 hours'))
->setScope(array(
'demoscope1',
'demoscope2',
));
$manager->persist($model);
$model = new AccessToken();
$model->setAccessToken('bcc105b66698a64ed23c87b967885289')
->setTokenType('bearer')
->setClientId('http://democlient1.com/')
->setUsername('demousername1')
->setExpires(new \DateTime('+1 hours'))
->setScope(array(
'demoscope3',
));
$manager->persist($model);
$manager->flush();
}
}