Merge pull request #7712 from Wikia/DAT-2965

DAT-2965 remove type hinting, to prevent fatal errors
This commit is contained in:
Rodrigo Molinero Gomez 2015-07-02 12:42:15 +02:00
commit def6be16b8
2 changed files with 13 additions and 1 deletions

View file

@ -14,7 +14,7 @@ class PortableInfoboxDataService {
$this->title = $title;
}
public static function newFromTitle( Title $title ) {
public static function newFromTitle( $title ) {
return new PortableInfoboxDataService( $title );
}

View file

@ -77,4 +77,16 @@ class PortableInfoboxDataServiceTest extends PHPUnit_Framework_TestCase {
$this->assertTrue( in_array( "Test2.jpg", $images ), "Test2.jpg should be in images array" );
}
public function testTitleNullConstructor() {
$service = PortableInfoboxDataService::newFromTitle(null);
$result = $service->getData();
$this->assertEquals( [], $result );
}
public function testConstructor() {
$service = PortableInfoboxDataService::newFromPageID(null);
$result = $service->getData();
$this->assertEquals( [], $result );
}
}