-
-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MODM-46] Fixing issue with @AlsoLoad extending the @field annotation…
… when it should not
- Loading branch information
Showing
4 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM46Test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace Doctrine\ODM\MongoDB\Tests\Functional\Ticket; | ||
|
||
require_once __DIR__ . '/../../../../../../TestInit.php'; | ||
|
||
class MODM46Test extends \Doctrine\ODM\MongoDB\Tests\BaseTest | ||
{ | ||
public function testTest() | ||
{ | ||
$this->dm->getMongo()->modm46_test->a->insert(array( | ||
'c' => array('tmp' => 'tmp') | ||
)); | ||
|
||
$a = $this->dm->findOne(__NAMESPACE__.'\MODM46A'); | ||
$this->assertTrue(isset($a->b)); | ||
$this->assertEquals('tmp', $a->b->tmp); | ||
} | ||
} | ||
|
||
/** @Document(db="modm46_test", collection="a") */ | ||
class MODM46A | ||
{ | ||
/** @Id */ | ||
public $id; | ||
|
||
/** | ||
* @EmbedOne(targetDocument="MODM46AB") | ||
* @AlsoLoad("c") | ||
*/ | ||
public $b; | ||
} | ||
|
||
/** @EmbeddedDocument */ | ||
class MODM46AB | ||
{ | ||
public $tmp = 'tmp'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ class AlsoLoad | |
public $id; | ||
|
||
/** | ||
* @String | ||
* @AlsoLoad({"bar", "zip"}) | ||
*/ | ||
public $foo; | ||
|