Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[MODM-117] Adding test for issue.

  • Loading branch information...
commit cb1cbd2e81b8912dd5959f1d6275443679959a86 1 parent bfda83d
@jwage jwage authored
Showing with 42 additions and 0 deletions.
  1. +42 −0 tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM117Test.php
View
42 tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM117Test.php
@@ -0,0 +1,42 @@
+<?php
+
+namespace Doctrine\ODM\MongoDB\Tests\Functional\Ticket;
+
+class MODM117Test extends \Doctrine\ODM\MongoDB\Tests\BaseTest
+{
+ public function testIssue()
+ {
+ $user = new MODM117User();
+ $user->first_name = 'jon';
+ $user->last_name = 'wage';
+ $this->dm->persist($user);
+ $this->dm->flush();
+
+ $check = $this->dm->getDocumentCollection(get_class($user))->findOne();
+ $this->assertEquals('jon', $check['first_name']);
+ $this->assertEquals('wage', $check['last_name']);
+ }
+}
+
+/** @Document */
+class MODM117User
+{
+ /** @Id */
+ public $id;
+
+ /** @Field(type="string") */
+ public $first_name;
+
+ /** @Field(type="string", name="last_name") */
+ protected $_last_name;
+
+ public function __get($name)
+ {
+ return $this->{'_'.$name};
+ }
+
+ public function __set($name, $value)
+ {
+ $this->{'_'.$name} = $value;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.