/** * @When /^los siguientes centros:$/ */ public function losSiguientesCentros(TableNode $table) { foreach ($table->getHash() as $row) { $faculty = new Faculty(); $faculty->setName($row['nombre']); $faculty->setSlug($row['código']); $faculty->setIsEnabled($row['activo'] === 'sí'); $this->getEntityManager()->persist($faculty); } $this->getEntityManager()->flush(); }
public function it_cannot_renew_a_disabled_faculty(Faculty $faculty, Rental $rental) { $faculty->getIsEnabled()->shouldBeCalled()->willReturn(false); $this->shouldThrow(PenalizedFacultyException::class)->duringRenewRental($rental); }
public function it_cannot_rent_to_disabled_faculties(Faculty $faculty, Locker $locker, User $user) { $faculty->getIsEnabled()->willReturn(false); $this->shouldThrow(PenalizedFacultyException::class)->duringRentLocker($user, $locker); }