Pantheon\Terminus\UnitTests\Commands\Redis\EnableCommandTest::testEnable PHP Method

testEnable() public method

Tests the redis:enable command
public testEnable ( )
    public function testEnable()
    {
        $workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock();
        // workflow succeeded
        $workflow->expects($this->once())->method('checkProgress')->willReturn(true);
        $workflow->expects($this->once())->method('getMessage')->willReturn('successful workflow');
        $this->redis = $this->getMockBuilder(Redis::class)->disableOriginalConstructor()->getMock();
        $this->redis->expects($this->once())->method('enable');
        $this->site->expects($this->once())->method('converge')->willReturn($workflow);
        $this->site->method('getRedis')->willReturn($this->redis);
        $this->logger->expects($this->at(0))->method('log')->with($this->equalTo('notice'), $this->equalTo('Redis enabled. Converging bindings.'));
        $this->logger->expects($this->at(1))->method('log')->with($this->equalTo('notice'), $this->equalTo('successful workflow'));
        $command = new EnableCommand();
        $command->setSites($this->sites);
        $command->setLogger($this->logger);
        $command->enable('mysite');
    }
EnableCommandTest