CakeDC\Users\Test\TestCase\Controller\Traits\RegisterTraitTest::testRegister PHP Метод

testRegister() публичный Метод

test
public testRegister ( ) : void
Результат void
    public function testRegister()
    {
        $this->assertEquals(0, $this->table->find()->where(['username' => 'testRegistration'])->count());
        $this->_mockRequestPost();
        $this->_mockAuth();
        $this->_mockFlash();
        $this->_mockDispatchEvent();
        $this->Trait->Flash->expects($this->once())->method('success')->with('Please validate your account before log in');
        $this->Trait->expects($this->once())->method('redirect')->with(['action' => 'login']);
        $this->Trait->request->data = ['username' => 'testRegistration', 'password' => 'password', 'email' => '[email protected]', 'password_confirm' => 'password', 'tos' => 1];
        $this->Trait->register();
        $this->assertEquals(1, $this->table->find()->where(['username' => 'testRegistration'])->count());
    }