PhpBench\Tests\Unit\Console\Command\LogCommandTest::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        if (!class_exists(QuestionHelper::class)) {
            $this->markTestSkipped('Not testing if QuestionHelper class does not exist (< Symfony 2.7)');
        }
        $this->storage = $this->prophesize(Registry::class);
        $this->timeUnit = $this->prophesize(TimeUnit::class);
        $this->timeUnitHandler = $this->prophesize(TimeUnitHandler::class);
        $this->characterReader = $this->prophesize(CharacterReader::class);
        $this->command = new LogCommand($this->storage->reveal(), $this->timeUnit->reveal(), $this->timeUnitHandler->reveal(), $this->characterReader->reveal());
        $this->application = new Application();
        $this->command->setApplication($this->application);
        $this->driver = $this->prophesize(DriverInterface::class);
        $this->storage->getService()->willReturn($this->driver->reveal());
        $this->output = new BufferedOutput();
        $this->history = $this->prophesize(HistoryIteratorInterface::class);
        $this->timeUnit->toDestUnit(Argument::cetera())->will(function ($time) {
            return $time[0];
        });
        $this->timeUnit->format(Argument::cetera())->will(function ($time) {
            return $time[0];
        });
        $this->timeUnit->getDestSuffix()->willReturn('s');
    }