public function testFetchOneForEmailAndSecurityKey()
 {
     $data = array('email' => '*****@*****.**', 'security_key' => 'udKdSEiRgIF3T11q6S5o8MmW07NlAS6P');
     $expectedSelect = $this->getSelect('member_password_resets');
     $expectedSelect->where(['mpr_email = ?' => $data['email'], 'mpr_security_key = ?' => $data['security_key']]);
     $expectedMemberPasswordResetModel = $this->getMockMemberPasswordResetsMapper()->createModelFromData($data);
     $this->mockTableGateway->shouldReceive('selectWith')->with($this->compareSqlString($expectedSelect))->andReturn($this->createResultSetFromDataWithPrefix($data, 'mpr_'))->once();
     $returnedModel = $this->memberPasswordResetsMapper->fetchOneForEmailAndSecurityKey($data['email'], $data['security_key']);
     $this->assertEquals($expectedMemberPasswordResetModel, $returnedModel);
 }
Esempio n. 2
0
 public function testFetchManyForEventIdNoneFound()
 {
     $data = array('id' => '45', 'person_id' => '34');
     $expectedSelect = $this->getSelect('costs');
     $expectedSelect->where(['cost_person_id=?' => $data['person_id']]);
     $resultSet = $this->createEmptyResultSet();
     $this->mockTableGateway->shouldReceive('selectWith')->with($this->compareSqlString($expectedSelect))->andReturn($resultSet)->once();
     $returnedModelsArray = $this->costsMapper->fetchManyForEventId($data['person_id']);
     $this->assertEquals([], $returnedModelsArray);
 }
Esempio n. 3
0
 public function testFetchManyForContactEmailNoneFound()
 {
     $data = array('email' => '*****@*****.**');
     $expectedSelect = $this->getSelect('people');
     $expectedSelect->where->like('person_contact_email', "%{$data['email']}%");
     $resultSet = $this->createEmptyResultSet();
     $this->mockTableGateway->shouldReceive('selectWith')->with($this->compareSqlString($expectedSelect))->andReturn($resultSet)->once();
     $returnedModelsArray = $this->peopleMapper->fetchManyForContactEmail($data['email']);
     $this->assertEquals([], $returnedModelsArray);
 }
Esempio n. 4
0
 public function testFetchOneForAddressNoneFound()
 {
     $addressArray = array('address_1' => '2530 Gilbert Ave', 'address_2' => '', 'city' => 'Missoula', 'state' => 'MT', 'postal_code' => '59801', 'country' => 'USA');
     $expectedSelect = $this->getSelect('venues');
     $expectedSelect->where(array('venue_address_1' => $addressArray['address_1'], 'venue_city' => $addressArray['city'], 'venue_state' => $addressArray['state'], 'venue_postal_code' => $addressArray['postal_code'], 'venue_country' => $addressArray['country']));
     $resultSet = $this->createEmptyResultSet();
     $this->mockTableGateway->shouldReceive('selectWith')->with($this->compareSqlString($expectedSelect))->andReturn($resultSet)->once();
     $returnedModel = $this->venuesMapper->fetchOneForAddress($addressArray);
     $this->assertEquals(null, $returnedModel);
 }