CakeDC\Users\Test\TestCase\Controller\Traits\LoginTraitTest::testAfterIdentifyEmptyUser PHP Метод

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

test
public testAfterIdentifyEmptyUser ( ) : void
Результат void
    public function testAfterIdentifyEmptyUser()
    {
        $this->_mockDispatchEvent(new Event('event'));
        $this->Trait->request = $this->getMockBuilder('Cake\\Network\\Request')->setMethods(['is'])->getMock();
        $this->Trait->request->expects($this->any())->method('is')->with('post')->will($this->returnValue(true));
        $this->Trait->Auth = $this->getMockBuilder('Cake\\Controller\\Component\\AuthComponent')->setMethods(['user', 'identify', 'setUser', 'redirectUrl'])->disableOriginalConstructor()->getMock();
        $user = [];
        $this->Trait->Auth->expects($this->once())->method('identify')->will($this->returnValue($user));
        $this->Trait->Flash = $this->getMockBuilder('Cake\\Controller\\Component\\FlashComponent')->setMethods(['error'])->disableOriginalConstructor()->getMock();
        $this->Trait->Flash->expects($this->once())->method('error')->with('Username or password is incorrect', 'default', [], 'auth');
        $this->Trait->login();
    }