예제 #1
0
 public function testUseDatabase()
 {
     $this->module->useDatabase('example');
     $this->module->haveInCollection('stuff', array('name' => 'Ashley', 'email' => '*****@*****.**'));
     $this->module->seeInCollection('stuff', array('name' => 'Ashley', 'email' => '*****@*****.**'));
     $this->module->dontSeeInCollection('users', array('email' => '*****@*****.**'));
 }
예제 #2
0
 public function testSeeElementIsObjectThrowsError()
 {
     $trumpet = new \StdClass();
     $trumpet->name = 'Trumpet 1';
     $trumpet->pitch = 'B♭';
     $trumpet->price = array('min' => 458, 'max' => 891);
     $this->setExpectedException('PHPUnit_Framework_ExpectationFailedException');
     $this->userCollection->insert(array('id' => 5, 'trumpet' => $trumpet));
     $this->userCollection->insert(array('id' => 6, 'trumpet' => $trumpet));
     $this->module->seeElementIsObject('users', array(), 'trumpet');
 }
예제 #3
0
 public function testGrabFromCollection()
 {
     $user = $this->module->grabFromCollection('users', array('id' => 1));
     $this->assertTrue(isset($user['email']));
     $this->assertEquals('*****@*****.**', $user['email']);
 }