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()); }
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()); }