CakeDC\Users\Test\TestCase\Controller\SocialAccountsControllerTest::testResendValidationHappy PHP Метод

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

test
public testResendValidationHappy ( ) : void
Результат void
    public function testResendValidationHappy()
    {
        $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(true));
        $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 sent successfully', $this->Controller->request->session()->read('Flash.flash.0.message'));
    }