/** * @covers sAdmin::sSaveRegisterMainData */ public function testsSaveRegisterMainData() { $password = Shopware()->PasswordEncoder()->encodePassword('foo', 'bcrypt'); $testData = array('auth' => array('password' => $password, 'email' => uniqid() . '*****@*****.**', 'accountmode' => 1, 'encoderName' => 'bcrypt'), 'payment' => array('object' => array('id' => 2))); $this->module->sSYSTEM->sSESSION_ID = uniqid(); $this->session->offsetSet('sessionId', $this->module->sSYSTEM->sSESSION_ID); $result = $this->module->sSaveRegisterMainData($testData); /** @var $customer Shopware\Models\Customer\Customer */ $customer = Shopware()->Db()->fetchRow('SELECT * FROM s_user WHERE id = ?', array($result)); $this->assertEquals($testData['auth']['email'], $customer['email']); $this->assertEquals($customer['password'], $password); $this->assertEquals($testData['auth']['accountmode'], $customer['accountmode']); $this->assertEquals(2, $customer['paymentID']); return $result; }