Example #1
0
 /**
  * @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());
 }
Example #2
0
 /**
  * @param bool $isAdminStore
  * @param array $customerData
  * @param array $expectedData
  * @dataProvider forceConfirmedDataProvider
  */
 public function testCreateForceConfirmed($isAdminStore, array $customerData, array $expectedData)
 {
     if (array_key_exists('autogenerate_password', $customerData)) {
         $this->_customer->expects($this->once())->method('generatePassword')->will($this->returnValue('generated_password'));
     }
     $this->_customer->expects($this->once())->method('save');
     $this->_service->setIsAdminStore($isAdminStore);
     $this->assertInstanceOf('Mage_Customer_Model_Customer', $this->_service->create($customerData));
     $this->assertEquals($expectedData, $this->_customer->toArray(array_keys($expectedData)));
 }