N98\Magento\Command\System\Setup\RemoveCommandTest::testRemoveModule PHP Method

testRemoveModule() public method

public testRemoveModule ( )
    public function testRemoveModule()
    {
        $mockAdapter = $this->getMockBuilder('\\Varien_Db_Adapter_Pdo_Mysql')->disableOriginalConstructor()->setMethods(array('delete'))->getMock();
        $mockAdapter->expects($this->once())->method('delete')->will($this->returnValue(1));
        $coreResource = $this->getMock('\\Mage_Core_Model_Resource');
        $coreResource->expects($this->once())->method('getConnection')->will($this->returnValue($mockAdapter));
        $command = $this->getMockBuilder('\\N98\\Magento\\Command\\System\\Setup\\RemoveCommand')->setMethods(array('_getModel'))->getMock();
        $command->expects($this->once())->method('_getModel')->with('core/resource', 'Mage_Core_Model_Resource')->will($this->returnValue($coreResource));
        $application = $this->getApplication();
        $application->add($command);
        $command = $this->getApplication()->find('sys:setup:remove');
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), 'module' => 'Mage_Weee'));
        $this->assertContains('Successfully removed setup resource: "weee_setup" from module: "Mage_Weee"', $commandTester->getDisplay());
    }