PhilippBaschke\ACFProInstaller\Test\PluginTest::testThrowExceptionWhenKeyIsMissing PHP Méthode

testThrowExceptionWhenKeyIsMissing() public méthode

    public function testThrowExceptionWhenKeyIsMissing()
    {
        // Expect an Exception
        $this->setExpectedException('PhilippBaschke\\ACFProInstaller\\Exceptions\\MissingKeyException', 'ACF_PRO_KEY');
        // Mock a RemoteFilesystem
        $rfs = $this->getMockBuilder('Composer\\Util\\RemoteFilesystem')->disableOriginalConstructor()->getMock();
        // Mock an Event
        $event = $this->getMockBuilder('Composer\\Plugin\\PreFileDownloadEvent')->disableOriginalConstructor()->setMethods(['getProcessedUrl', 'getRemoteFilesystem'])->getMock();
        $event->expects($this->once())->method('getProcessedUrl')->willReturn(self::REPO_URL);
        $event->expects($this->once())->method('getRemoteFilesystem')->willReturn($rfs);
        // Call addKey
        $plugin = new Plugin();
        $plugin->addKey($event);
    }