예제 #1
0
 public function testSendApprovalEmailToAdminNoAdminFound()
 {
     $dataVenue = array('id' => '25', 'name' => 'Charlie Night Social');
     $venueModel = $this->getMockVenuesMapper()->createModelFromData($dataVenue);
     $this->getMockMembersMapper()->shouldReceive('fetchOneForAdminPrivileges')->withNoArgs()->andReturnNull()->once();
     $processResult = $this->venuesProcess->sendApprovalEmailToAdmin($venueModel);
     $this->assertEquals($this->getProcessResultFailure('No administrator on file'), $processResult);
 }
예제 #2
0
 public function testSendApprovalEmailToAdmin()
 {
     $dataEvent = array('id' => '25', 'name' => 'Charlie Night Social');
     $personModel = $this->getMockPeopleMapper()->createModelFromData($dataEvent);
     $adminMemberModel = $this->getMockMembersMapper()->createModelFromData();
     $this->getMockMembersMapper()->shouldReceive('fetchOneForAdminPrivileges')->withNoArgs()->andReturn($adminMemberModel)->once();
     $this->getMockEmailsProcess()->shouldReceive('sendEmailFromTemplate')->andReturnNull()->once();
     $personModelProcessResult = $this->peopleProcess->sendApprovalEmailToAdmin($personModel);
     $this->assertEquals($this->getProcessResultSuccess(), $personModelProcessResult);
 }