From b7b107b08ac22ec385b6461538832bd25e6f6547 Mon Sep 17 00:00:00 2001 From: Adam Prager Date: Sun, 7 Apr 2013 16:26:05 +0200 Subject: [PATCH] moved test entities from sandbox --- .../Tests/Models/DDC2372/DDC2372Address.php | 45 +++++++++++++++++++ .../Tests/Models/DDC2372/DDC2372User.php | 10 ++--- .../DDC2372/Traits/DDC2372AddressTrait.php | 6 +-- .../Tests/ORM/Tools/EntityGeneratorTest.php | 10 ++--- tests/Doctrine/Tests/TestInit.php | 1 - 5 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php rename tools/sandbox/Entities/TraitedUser.php => tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php (68%) rename tools/sandbox/Entities/Traits/AddressTrait.php => tests/Doctrine/Tests/Models/DDC2372/Traits/DDC2372AddressTrait.php (69%) diff --git a/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php b/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php new file mode 100644 index 000000000..26144c61d --- /dev/null +++ b/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php @@ -0,0 +1,45 @@ +id; + } + + public function getStreet() + { + return $this->street; + } + + public function setStreet($street) + { + $this->street = $street; + } + + public function getUser() + { + return $this->user; + } + + public function setUser(User $user) + { + if ($this->user !== $user) { + $this->user = $user; + $user->setAddress($this); + } + } +} \ No newline at end of file diff --git a/tools/sandbox/Entities/TraitedUser.php b/tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php similarity index 68% rename from tools/sandbox/Entities/TraitedUser.php rename to tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php index fe0b68754..4df0df6a5 100644 --- a/tools/sandbox/Entities/TraitedUser.php +++ b/tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php @@ -1,13 +1,13 @@ _getTestEntityManager(); $cmf->setEntityManager($em); - $user = new TraitedUser(); + $user = new DDC2372User(); $metadata = $cmf->getMetadataFor(get_class($user)); - $metadata->name = $this->_namespace . "\TraitedUser"; + $metadata->name = $this->_namespace . "\DDC2372User"; $metadata->namespace = $this->_namespace; $this->_generator->writeEntityClass($metadata, $this->_tmpDir); - $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/TraitedUser.php"); - require $this->_tmpDir . "/" . $this->_namespace . "/TraitedUser.php"; + $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"); + require $this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"; $reflClass = new \ReflectionClass($metadata->name); diff --git a/tests/Doctrine/Tests/TestInit.php b/tests/Doctrine/Tests/TestInit.php index ac7f7354b..c257a75b6 100644 --- a/tests/Doctrine/Tests/TestInit.php +++ b/tests/Doctrine/Tests/TestInit.php @@ -17,7 +17,6 @@ if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { } /* @var $classLoader \Composer\Autoload\ClassLoader */ -$classLoader->add('Entities', __DIR__ . '/../../../tools/sandbox'); $classLoader->add('Doctrine\\Tests\\', __DIR__ . '/../../'); unset($classLoader);