N98\Magento\Command\Customer\DeleteCommandTest::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        $this->application = $this->getApplication();
        $this->application->initMagento();
        $this->customerModel = $this->getCustomerModel(array('loadByEmail', 'load', 'getId', 'delete', 'setWebsiteId'));
        $this->customerCollection = $this->getCustomerCollection(array('addAttributeToSelect', 'addAttributeToFilter'));
        $this->command = $this->getMockBuilder('\\N98\\Magento\\Command\\Customer\\DeleteCommand')->setMethods(array('getCustomerModel', 'getCustomerCollection', 'ask', 'askConfirmation', 'getHelper', 'batchDelete'))->getMock();
        $this->dialog = $this->getMockBuilder('Symfony\\Component\\Console\\Helper\\DialogHelper')->setMethods(array('ask', 'askConfirmation', 'askAndValidate', 'askWebsite', 'getQuestion'))->getMock();
        $this->parameter = $this->getMockBuilder('Symfony\\Component\\Console\\Helper\\ParameterHelper')->setMethods(array('askWebsite'))->getMock();
        $this->website = $this->getMockBuilder('Mage_Core_Model_Website')->setMethods(array('getId'))->getMock();
        $this->command->expects($this->any())->method('getCustomerModel')->will($this->returnValue($this->customerModel));
        $this->command->expects($this->any())->method('getCustomerCollection')->will($this->returnValue($this->customerCollection));
        $this->command->expects($this->any())->method('getHelper')->will($this->returnValueMap(array(array('dialog', $this->dialog), array('parameter', $this->parameter))));
        $this->dialog->expects($this->any())->method('getQuestion')->will($this->returnArgument(0));
        $this->parameter->expects($this->any())->method('askWebsite')->will($this->returnValue($this->website));
        $this->website->expects($this->any())->method('getId')->will($this->returnValue(1));
    }