Exemplo n.º 1
0
 public function testQuerySingle()
 {
     $targetPerson = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 7), self::getTestClauses());
     $this->helperVerifyKarenWolfe($targetPerson);
     $objTwoKey = TwoKey::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::TwoKey()->Server, 'google.com'), QQ::Equal(QQN::TwoKey()->Directory, 'mail')), QQ::Clause(QQ::ExpandAsArray(QQN::TwoKey()->Project->PersonAsTeamMember)));
     $this->assertEqual(count($objTwoKey->Project->_PersonAsTeamMemberArray), 6, '6 team members found.');
 }
Exemplo n.º 2
0
 public function testLoadAll()
 {
     $objPersonArray = Person::LoadAll();
     $this->assertEqual(count($objPersonArray), 12, "12 people found.");
     $objTwoKeyArray = TwoKey::LoadAll();
     $this->assertEqual(count($objTwoKeyArray), 6, "6 TwoKey items found.");
 }
Exemplo n.º 3
0
 public function testQuerySingle()
 {
     $targetPerson = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 7), self::getTestClauses());
     $this->helperVerifyKarenWolfe($targetPerson);
     $targetPerson2 = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 7), array(QQ::Select(QQN::Person()->FirstName)));
     $this->assertNotNull($targetPerson2->LastName, "Used a cached object");
     $targetPerson2->Save();
     $targetPerson2 = Person::QuerySingle(QQ::Equal(QQN::Person()->Id, 7), array(QQ::Select(QQN::Person()->FirstName)));
     $this->assertNull($targetPerson2->LastName, "Saving an object deleted it from the cache");
     $objTwoKey = TwoKey::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::TwoKey()->Server, 'google.com'), QQ::Equal(QQN::TwoKey()->Directory, 'mail')), QQ::Clause(QQ::ExpandAsArray(QQN::TwoKey()->Project->PersonAsTeamMember)));
     $this->assertEquals(count($objTwoKey->Project->_PersonAsTeamMemberArray), 6, '6 team members found.');
 }