Ejemplo n.º 1
0
 /**
  * @test
  */
 public function it_should_have_a_name_and_company()
 {
     $company = Company::createWithoutServices(new CompanyName('FooBar'));
     $service = Service::offer(new ProvidedService('Hammers for Rental'), $company);
     $this->assertSame($company, $service->getCompany());
     $this->assertEquals(new ProvidedService('Hammers for Rental'), $service->getProvidedService());
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 function load(ObjectManager $manager)
 {
     $service = Service::offer(new ProvidedService('100MB Internet'), $this->getReference('company_vm'));
     $this->setReference('service_internet', $service);
     $manager->persist($service);
     $manager->flush();
 }
Ejemplo n.º 3
0
 /**
  * @test
  */
 public function it_should_be_able_to_offer_services_after_instantiation()
 {
     $company = Company::createWithoutServices(new CompanyName('Acme'));
     $this->assertEquals(new \Doctrine\Common\Collections\ArrayCollection(), $company->getOfferedServices());
     $service = Service::offer(new ProvidedService('Hammers for Renting'), $company);
     $company->offerService($service);
     $services = new \Doctrine\Common\Collections\ArrayCollection([$service]);
     $this->assertEquals($services, $company->getOfferedServices());
 }
Ejemplo n.º 4
0
 /**
  * @return Service
  */
 private function createServicesAndCompany()
 {
     $company = Company::createWithoutServices(new Value\CompanyName('Acme'));
     return Service::offer(new Value\ProvidedService('Hammers for Rental'), $company);
 }