示例#1
0
 /**
  * @covers sAdmin::sGetUserMailById
  * @covers sAdmin::sGetUserByMail
  * @covers sAdmin::sGetUserNameById
  */
 public function testGetEmailAndUser()
 {
     $customer = $this->createDummyCustomer();
     // Test sGetUserMailById with null and expected cases
     $this->assertNull($this->module->sGetUserMailById());
     $this->session->offsetSet('sUserId', $customer->getId());
     $this->assertEquals($customer->getEmail(), $this->module->sGetUserMailById());
     // Test sGetUserByMail with null and expected cases
     $this->assertNull($this->module->sGetUserByMail(uniqid()));
     $this->assertEquals($customer->getId(), $this->module->sGetUserByMail($customer->getEmail()));
     // Test sGetUserNameById with null and expected cases
     $this->assertEmpty($this->module->sGetUserNameById(uniqid()));
     $this->assertEquals(array('firstname' => 'Max', 'lastname' => 'Mustermann'), $this->module->sGetUserNameById($customer->getId()));
     $this->deleteDummyCustomer($customer);
 }