public function testBuild()
 {
     $state = $this->getState();
     $config = $this->getConfig();
     $prepare = new SimpleContainer();
     $prepare->addBuilder($builder = new ExceptionBuilder($this->getConfig(), 'NotFoundException'));
     $prepare->prepare($state);
     $builder->build($state);
     $fixture = file_get_contents(__DIR__ . "/fixture/exception.txt");
     $this->assertEquals($fixture, $state->getModel('NotFoundException')->getGenerator()->generate());
 }
 public function testBuild()
 {
     $state = $this->getState();
     $config = $this->getConfig();
     $prepare = new SimpleContainer();
     $prepare->addBuilder(new EntityBuilder($config));
     $prepare->addBuilder($builder = new EntityTestBuilder($config));
     $prepare->prepare($state);
     $builder->build($state);
     $fixture = file_get_contents(__DIR__ . "/fixture/test.txt");
     $this->assertEquals($fixture, $state->getModel('entity-test')->getGenerator()->generate());
 }
Exemplo n.º 3
0
 /**
  * @dataProvider configProvider
  */
 public function testBuild($name)
 {
     $state = $this->getState();
     $config = $this->getConfig();
     $prepare = new SimpleContainer();
     $prepare->addBuilder(new EntityBuilder($config));
     $prepare->addBuilder($builder = new ConfigBuilder($this->getConfig(), $name));
     $prepare->prepare($state);
     $builder->build($state);
     $fixture = file_get_contents(__DIR__ . "/fixture/" . basename($name, '.php') . '.txt');
     $this->assertEquals($fixture, $state->getModel($name)->getGenerator()->generate(), $name);
 }
 public function testBuild()
 {
     $state = $this->getState();
     $config = $this->getConfig();
     $prepare = new SimpleContainer();
     $prepare->addBuilder(new EntityBuilder($config));
     $prepare->addBuilder(new ServiceBuilder($config));
     $prepare->addBuilder(new ServiceTraitBuilder($config));
     $prepare->addBuilder(new FormFactoryBuilder($config));
     $prepare->addBuilder($builder = new RESTControllerBuilder($config));
     $prepare->prepare($state);
     $builder->build($state);
     $fixture = file_get_contents(__DIR__ . "/fixture/rest.txt");
     $this->assertEquals($fixture, $state->getModel('controller')->getGenerator()->generate());
 }
Exemplo n.º 5
0
 public function testBuild()
 {
     $state = $this->getState();
     $config = $this->getConfig();
     $prepare = new SimpleContainer();
     $prepare->addBuilder(new EntityBuilder($config));
     $prepare->addBuilder(new ExceptionContainer($config));
     $prepare->addBuilder(new RepositoryBuilder($config));
     $prepare->addBuilder(new RepositoryTraitBuilder($config));
     $prepare->addBuilder($builder = new ServiceBuilder($config));
     $prepare->prepare($state);
     $builder->build($state);
     $fixture = file_get_contents(__DIR__ . "/fixture/service.txt");
     $this->assertEquals($fixture, $state->getModel('service')->getGenerator()->generate());
 }