N98\Magento\Command\System\Setup\ChangeVersionCommandTest::testChangeVersion PHP Method

testChangeVersion() public method

public testChangeVersion ( )
    public function testChangeVersion()
    {
        $command = $this->getMockBuilder('\\N98\\Magento\\Command\\System\\Setup\\ChangeVersionCommand')->setMethods(array('_getResourceSingleton'))->getMock();
        $resourceModel = $this->getMockBuilder('\\Mage_Core_Model_Resource_Resource')->disableOriginalConstructor()->setMethods(array('setDbVersion', 'setDataVersion'))->getMock();
        $command->expects($this->once())->method('_getResourceSingleton')->will($this->returnValue($resourceModel));
        $resourceModel->expects($this->once())->method('setDbVersion')->with('weee_setup', '1.6.0.0');
        $resourceModel->expects($this->once())->method('setDataVersion')->with('weee_setup', '1.6.0.0');
        $application = $this->getApplication();
        $application->add($command);
        $command = $this->getApplication()->find('sys:setup:change-version');
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), 'module' => 'Mage_Weee', 'version' => '1.6.0.0'));
        $this->assertContains('Successfully updated: "Mage_Weee" - "weee_setup" to version: "1.6.0.0"', $commandTester->getDisplay());
    }