Example #1
0
 /**
  * Test getter and setter of validated property.
  *
  * @covers AppBundle\Entity\Validation::setValidated()
  * @covers AppBundle\Entity\Validation::getValidated()
  * @covers AppBundle\Entity\Validation::isValidated()
  */
 public function testValidated()
 {
     $this->assertFalse($this->validation->isValidated());
     $this->assertNull($this->validation->getValidated());
     $validated = new \DateTime();
     $this->validation->setValidated($validated);
     $this->assertTrue($this->validation->isValidated());
     $this->assertEquals($validated, $this->validation->getValidated());
 }
 /**
  * Test stay Waiting of an annuaire.
  *
  * @covers AppBundle\Model\AnnuaireManager::stayWaitingAnnuaire
  */
 public function testStayWaitingAnnuaire()
 {
     $user = new User();
     $annuaire = $this->object->createAnnuaire();
     $expected = new Validation();
     $expected->setValidator($user);
     $expected->setStatus(Validation::EN_ATTENTE);
     $this->object->stayWaitingAnnuaire($annuaire, $user);
     $this->assertEquals($expected, $annuaire->getValidation());
     $expected->setReason('foo');
     $this->object->stayWaitingAnnuaire($annuaire, $user, 'foo');
     $this->assertEquals($expected, $annuaire->getValidation());
 }