protected function setUp()
 {
     $this->creator = $this->prophesize(Creator::class);
     $this->migrator = $this->prophesize(Migrator::class);
     $this->container = $this->prophesize(ContainerInterface::class);
     $this->migrator->paths()->willReturn([]);
     Promise::containerHasService($this->container, 'wouterj_eloquent.migrations.creator', $this->creator->reveal());
     Promise::containerHasService($this->container, 'wouterj_eloquent.migrator', $this->migrator->reveal());
     Promise::containerHasParameter($this->container, 'wouterj_eloquent.migration_path', __DIR__ . '/migrations');
     $this->command = new MigrateMakeCommand();
     $this->command->setcontainer($this->container->reveal());
 }
Exemplo n.º 2
0
 /** @test */
 public function it_executes_specified_classes()
 {
     $seederClass = __CLASS__ . '_DummySeeder';
     $seeder1Class = __CLASS__ . '_SecondDummySeeder';
     Promise::inputHasArgument($this->input, 'class', [$seederClass, $seeder1Class]);
     Promise::inputHasOption($this->input, 'database', null);
     $manager = $this->prophesize('Illuminate\\Database\\DatabaseManager');
     Promise::containerHasService($this->container, 'wouterj_eloquent.database_manager', $manager->reveal());
     Promise::containerDoesNotHaveService($this->container, $seederClass);
     Promise::containerDoesNotHaveService($this->container, $seeder1Class);
     Prediction::outputWritesLine($this->output, '<info>Seeded:</info> ' . $seederClass);
     Prediction::outputWritesLine($this->output, '<info>Seeded:</info> ' . $seeder1Class);
     $this->subject->execute($this->input->reveal(), $this->output->reveal());
 }
 protected function setUp()
 {
     $this->repository = $this->prophesize(MigrationRepositoryInterface::class);
     $this->repository->getRan()->willReturn([]);
     $this->migrator = $this->prophesize(Migrator::class);
     $this->migrator->paths()->willReturn([]);
     $this->migrator->setConnection(Argument::any())->willReturn(null);
     $this->migrator->repositoryExists()->willReturn(true);
     $this->migrator->getRepository()->willReturn($this->repository->reveal());
     $this->migrator->getMigrationName(Argument::any())->willReturnArgument(0);
     $this->migrator->getMigrationFiles(Argument::any())->willReturn(['Migration1', 'Migration2']);
     $container = $this->prophesize(ContainerInterface::class);
     Promise::containerHasService($container, 'wouterj_eloquent.migrator', $this->migrator->reveal());
     Promise::containerHasParameter($container, 'wouterj_eloquent.migration_path', __DIR__ . '/migrations');
     $this->command = new MigrateStatusCommand();
     $this->command->setContainer($container->reveal());
 }
Exemplo n.º 4
0
 public function it_fails_if_seeder_extends_illuminate_seeder()
 {
     Promise::containerHasService($this->container, 'foo_service', new SeerderTest_LaravelSeeder());
     $this->setExpectedException('LogicException');
     $this->subject->resolve('foo_service');
 }