public function testPrepareSourceAmounts() { $data = array('param_1_1' => 'param_1_2', 'amount' => '1,234.00', 'params_2_1' => array('amount' => '2,345.00'), 'params_3_1' => array('params_3_2' => array('amount' => '3,456.00'))); $this->_object->prepareSourceAmounts($data); $this->assertTrue(is_array($data)); $this->assertEquals('1234.00', $data['amount']); $this->assertEquals('2345.00', $data['params_2_1']['amount']); $this->assertEquals('3456.00', $data['params_3_1']['params_3_2']['amount']); }
public function testIsValidAddressStreetOnly() { $data = array('street' => 'test_street'); $mockAddress = $this->mockModel('customer/address', array('getData', 'getCountryModel', 'getRegion')); $mockAddress->expects($this->any())->method('getData')->will($this->returnValue($data)); $mockAddress->expects($this->any())->method('getCountryModel')->will($this->returnValue(new Varien_Object(array('name' => 'US')))); $mockAddress->expects($this->once())->method('getRegion')->will($this->returnValue('test_reqion')); $result = $this->_object->isValidAddress($mockAddress); $this->assertTrue($result); }