CakeDC\Users\Test\TestCase\Controller\SocialAccountsControllerTest::testResendValidationEmailError PHP Method

testResendValidationEmailError() public method

test
    public function testResendValidationEmailError()
    {
        $behaviorMock = $this->getMockBuilder('CakeDC\\Users\\Model\\Behavior\\SocialAccountBehavior')->setMethods(['sendSocialValidationEmail'])->setConstructorArgs([$this->Controller->SocialAccounts])->getMock();
        $this->Controller->SocialAccounts->behaviors()->set('SocialAccount', $behaviorMock);
        $behaviorMock->expects($this->once())->method('sendSocialValidationEmail')->will($this->returnValue(false));
        $this->Controller->expects($this->once())->method('redirect')->with(['plugin' => 'CakeDC/Users', 'controller' => 'Users', 'action' => 'login']);
        $this->Controller->resendValidation('Facebook', 'reference-1-1234');
        $this->assertEquals('Email could not be sent', $this->Controller->request->session()->read('Flash.flash.0.message'));
    }