File tree Expand file tree Collapse file tree 9 files changed +156
-4
lines changed
src/Symfony/Bridge/Doctrine Expand file tree Collapse file tree 9 files changed +156
-4
lines changed Original file line number Diff line number Diff line change 9
9
* file that was distributed with this source code.
10
10
*/
11
11
12
- namespace Symfony \Bridge \Doctrine \Types ;
12
+ namespace Symfony \Bridge \Doctrine \IdGenerator ;
13
13
14
14
use Doctrine \ORM \EntityManager ;
15
15
use Doctrine \ORM \Id \AbstractIdGenerator ;
Original file line number Diff line number Diff line change 9
9
* file that was distributed with this source code.
10
10
*/
11
11
12
- namespace Symfony \Bridge \Doctrine \Types ;
12
+ namespace Symfony \Bridge \Doctrine \IdGenerator ;
13
13
14
14
use Doctrine \ORM \EntityManager ;
15
15
use Doctrine \ORM \Id \AbstractIdGenerator ;
Original file line number Diff line number Diff line change 9
9
* file that was distributed with this source code.
10
10
*/
11
11
12
- namespace Symfony \Bridge \Doctrine \Types ;
12
+ namespace Symfony \Bridge \Doctrine \IdGenerator ;
13
13
14
14
use Doctrine \ORM \EntityManager ;
15
15
use Doctrine \ORM \Id \AbstractIdGenerator ;
Original file line number Diff line number Diff line change 9
9
* file that was distributed with this source code.
10
10
*/
11
11
12
- namespace Symfony \Bridge \Doctrine \Types ;
12
+ namespace Symfony \Bridge \Doctrine \IdGenerator ;
13
13
14
14
use Doctrine \ORM \EntityManager ;
15
15
use Doctrine \ORM \Id \AbstractIdGenerator ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bridge \Doctrine \Tests \IdGenerator ;
13
+
14
+ use Doctrine \ORM \EntityManager as DoctrineEntityManager ;
15
+
16
+ class EntityManager extends DoctrineEntityManager
17
+ {
18
+ public function __construct ()
19
+ {
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bridge \Doctrine \Tests \IdGenerator ;
13
+
14
+ use Doctrine \ORM \Mapping \Entity ;
15
+ use PHPUnit \Framework \TestCase ;
16
+ use Symfony \Bridge \Doctrine \IdGenerator \UlidGenerator ;
17
+ use Symfony \Component \Uid \AbstractUid ;
18
+ use Symfony \Component \Uid \Ulid ;
19
+
20
+ class UlidGeneratorTest extends TestCase
21
+ {
22
+ public function testUlidCanBeGenerated ()
23
+ {
24
+ $ em = new EntityManager ();
25
+ $ generator = new UlidGenerator ();
26
+ $ ulid = $ generator ->generate ($ em , new Entity ());
27
+
28
+ $ this ->assertInstanceOf (AbstractUid::class, $ ulid );
29
+ $ this ->assertInstanceOf (Ulid::class, $ ulid );
30
+ $ this ->assertTrue (Ulid::isValid ($ ulid ));
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bridge \Doctrine \Tests \IdGenerator ;
13
+
14
+ use Doctrine \ORM \Mapping \Entity ;
15
+ use PHPUnit \Framework \TestCase ;
16
+ use Symfony \Bridge \Doctrine \IdGenerator \UuidV1Generator ;
17
+ use Symfony \Component \Uid \AbstractUid ;
18
+ use Symfony \Component \Uid \UuidV1 ;
19
+
20
+ class UuidV1GeneratorTest extends TestCase
21
+ {
22
+ public function testUuidv1CanBeGenerated ()
23
+ {
24
+ $ em = new EntityManager ();
25
+ $ generator = new UuidV1Generator ();
26
+
27
+ $ uuid = $ generator ->generate ($ em , new Entity ());
28
+
29
+ $ this ->assertInstanceOf (AbstractUid::class, $ uuid );
30
+ $ this ->assertInstanceOf (UuidV1::class, $ uuid );
31
+ $ this ->assertTrue (UuidV1::isValid ($ uuid ));
32
+ }
33
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bridge \Doctrine \Tests \IdGenerator ;
13
+
14
+ use Doctrine \ORM \Mapping \Entity ;
15
+ use PHPUnit \Framework \TestCase ;
16
+ use Symfony \Bridge \Doctrine \IdGenerator \UuidV4Generator ;
17
+ use Symfony \Component \Uid \AbstractUid ;
18
+ use Symfony \Component \Uid \UuidV4 ;
19
+
20
+ class UuidV4GeneratorTest extends TestCase
21
+ {
22
+ public function testUuidv4CanBeGenerated ()
23
+ {
24
+ $ em = new EntityManager ();
25
+ $ generator = new UuidV4Generator ();
26
+
27
+ $ uuid = $ generator ->generate ($ em , new Entity ());
28
+
29
+ $ this ->assertInstanceOf (AbstractUid::class, $ uuid );
30
+ $ this ->assertInstanceOf (UuidV4::class, $ uuid );
31
+ $ this ->assertTrue (UuidV4::isValid ($ uuid ));
32
+ }
33
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bridge \Doctrine \Tests \IdGenerator ;
13
+
14
+ use Doctrine \ORM \Mapping \Entity ;
15
+ use PHPUnit \Framework \TestCase ;
16
+ use Symfony \Bridge \Doctrine \IdGenerator \UuidV6Generator ;
17
+ use Symfony \Component \Uid \AbstractUid ;
18
+ use Symfony \Component \Uid \UuidV6 ;
19
+
20
+ class UuidV6GeneratorTest extends TestCase
21
+ {
22
+ public function testUuidv6CanBeGenerated ()
23
+ {
24
+ $ em = new EntityManager ();
25
+ $ generator = new UuidV6Generator ();
26
+
27
+ $ uuid = $ generator ->generate ($ em , new Entity ());
28
+
29
+ $ this ->assertInstanceOf (AbstractUid::class, $ uuid );
30
+ $ this ->assertInstanceOf (UuidV6::class, $ uuid );
31
+ $ this ->assertTrue (UuidV6::isValid ($ uuid ));
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments