/** * @param bool $isAdminStore * @param boolean $isConfirmed * @dataProvider forceConfirmedDataProvider */ public function testCustomerSetForceConfirmed($isAdminStore, $isConfirmed) { $this->_model->setIsAdminStore($isAdminStore); $customerData = array('firstname' => 'ServiceTest', 'lastname' => 'ForceConfirmed', 'email' => 'test' . mt_rand(1000, 9999) . '@mail.com', 'password' => '123123q'); $this->_createdCustomer = $this->_model->create($customerData); $this->assertEquals($isConfirmed, $this->_createdCustomer->getForceConfirmed()); }
/** * @param array $customerData * @param int|null $origId * @dataProvider welcomeEmailNotCalledDataProvider */ public function testSendWelcomeEmailNotCalled(array $customerData, $origId) { $this->_customer->expects($this->never())->method('sendNewAccountEmail'); $this->_customer->expects($this->once())->method('save'); $this->_customer->expects($this->any())->method('getOrigData')->will($this->returnValue($origId)); if (array_key_exists('confirmation', $customerData)) { $this->_customer->expects($this->any())->method('getConfirmation')->will($this->returnValue($customerData['confirmation'])); } $this->assertInstanceOf('Mage_Customer_Model_Customer', $this->_service->create($customerData)); }