for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Wikibase\DataModel\Services\Tests\Lookup;
use Exception;
use Wikibase\DataModel\Services\Lookup\UnknownForeignRepositoryException;
/**
* @covers Wikibase\DataModel\Services\Lookup\UnknownForeignRepositoryException
*
* @license GPL-2.0+
*/
class UnknownForeignRepositoryExceptionTest extends \PHPUnit_Framework_TestCase {
public function testConstructWithRepositoryNameOnly() {
$exception = new UnknownForeignRepositoryException( 'foo' );
$this->assertSame( 'foo', $exception->getRepositoryName() );
$this->assertSame( 'Unknown repository name: foo', $exception->getMessage() );
$this->assertSame( 0, $exception->getCode() );
$this->assertNull( $exception->getPrevious() );
}
public function testConstructWithAllArguments() {
$previous = new Exception();
$exception = new UnknownForeignRepositoryException( 'foo', 'No such repository: foo', $previous );
$this->assertSame( 'No such repository: foo', $exception->getMessage() );
$this->assertSame( $previous, $exception->getPrevious() );