X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FORM%2FFunctional%2FUUIDGeneratorTest.php;fp=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FORM%2FFunctional%2FUUIDGeneratorTest.php;h=5fa237ee4d9e12e7394f15f0ef809e3e9b94d9ec;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fapplication_blanche.git diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php new file mode 100644 index 0000000..5fa237e --- /dev/null +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php @@ -0,0 +1,48 @@ +_em->getConnection()->getDatabasePlatform()->getName() != 'mysql') { + $this->markTestSkipped('Currently restricted to MySQL platform.'); + } + + $this->_schemaTool->createSchema(array( + $this->_em->getClassMetadata(__NAMESPACE__ . '\\UUIDEntity') + )); + } + + public function testGenerateUUID() + { + $entity = new UUIDEntity(); + + $this->_em->persist($entity); + $this->assertNotNull($entity->getId()); + $this->assertTrue(strlen($entity->getId()) > 0); + } +} + +/** + * @Entity + */ +class UUIDEntity +{ + /** @Id @Column(type="string") @GeneratedValue(strategy="UUID") */ + private $id; + /** + * Get id. + * + * @return id. + */ + public function getId() + { + return $this->id; + } +}