Esempio n. 1
0
 public function setUp()
 {
     parent::setUp();
     $this->_bob = My_ShantyMongo_User::find('4c04516a1f5f5e21361e3ab0');
     $this->_cherry = My_ShantyMongo_User::find('4c04516f1f5f5e21361e3ab1');
     $this->_roger = My_ShantyMongo_User::find('4c0451791f5f5e21361e3ab2');
     $this->_articleRegular = My_ShantyMongo_Article::find('4c04516f1f5f5e21361e3ac1');
     $this->_articleBroken = My_ShantyMongo_Article::find('4c04516f1f5f5e21361e3ac2');
 }
Esempio n. 2
0
 public function setUp()
 {
     parent::setUp();
     $this->_bob = My_ShantyMongo_User::find('4c04516a1f5f5e21361e3ab0');
     $this->_article = My_ShantyMongo_Article::find('4c04516f1f5f5e21361e3ac1');
 }
Esempio n. 3
0
 /**
  * This is to test a really obscure issue where DBRefs get save with null fields.
  **/
 public function testCleanDbRef()
 {
     $user = new My_ShantyMongo_User();
     $user->name = new My_ShantyMongo_Name(array('first' => 'Tom', 'last' => 'Holder'));
     $user->email = '*****@*****.**';
     $user->sex = 'M';
     $user->save();
     $var = $user->name->first;
     $article = new My_ShantyMongo_Article();
     $article->title = 'DBRefs should be clean';
     $article->author = $user;
     $article->save();
     $article = My_ShantyMongo_Article::find($article->getId());
     $exportedArticle = $article->export();
     //This key shouldn't be left behind on field which should be a DBRef.
     $this->assertArrayNotHasKey('name', $exportedArticle['author']);
 }