public function test_it_uses_correct_action_name() { $package1 = new Package('acme/my-project1', 'v1.0.0.0', 'v1.0.0'); $package2 = new Package('acme/my-project2', 'v1.0.1.0', 'v1.0.1'); $operationUpdate = new UpdateOperation($package1, $package2); $expectedOutput = [' - <fg=green>acme/my-project1</fg=green> updated from <fg=yellow>v1.0.0</fg=yellow> to <fg=yellow>v1.0.1</fg=yellow>']; $this->assertSame($expectedOutput, $this->SUT->getOutput($operationUpdate, null)); $operationDowngrade = new UpdateOperation($package2, $package1); $expectedOutput = [' - <fg=green>acme/my-project2</fg=green> downgraded from <fg=yellow>v1.0.1</fg=yellow> to <fg=yellow>v1.0.0</fg=yellow>']; $this->assertSame($expectedOutput, $this->SUT->getOutput($operationDowngrade, null)); }
/** * @expectedException \LogicException * @expectedExceptionMessage Operation should be an instance of UpdateOperation */ public function test_it_throws_exception_when_getting_output_from_non_update_operation() { $this->SUT->getOutput(new FakeOperation('')); }