public function testSchemaNotAvailable() {
$formatter = new AvroFormatter( array() );
- $this->setExpectedException( 'PHPUnit_Framework_Error_Notice', "The schema for channel 'marty' is not available" );
+ $this->setExpectedException(
+ 'PHPUnit_Framework_Error_Notice',
+ "The schema for channel 'marty' is not available"
+ );
$formatter->format( array( 'channel' => 'marty' ) );
}
'backend' => $backend
) ) );
- $repoMock->expects( $this->any() )->method( 'getMasterDB' )->will( $this->returnValue( $dbMock ) );
+ $repoMock
+ ->expects( $this->any() )
+ ->method( 'getMasterDB' )
+ ->will( $this->returnValue( $dbMock ) );
$this->migratorMock = $this->getMock( 'MigrateFileRepoLayout', array( 'getRepo' ) );
- $this->migratorMock->expects( $this->any() )->method( 'getRepo' )->will( $this->returnValue( $repoMock ) );
+ $this->migratorMock
+ ->expects( $this->any() )
+ ->method( 'getRepo' )
+ ->will( $this->returnValue( $repoMock ) );
$this->tmpFilepath = TempFSFile::factory( 'migratefilelayout-test-', 'png' )->getPath();
$hashPath = $repoMock->getHashPath( $filename );
- $status = $repoMock->store( $this->tmpFilepath, 'public', $hashPath . $filename, FileRepo::OVERWRITE );
+ $status = $repoMock->store(
+ $this->tmpFilepath,
+ 'public',
+ $hashPath . $filename,
+ FileRepo::OVERWRITE
+ );
}
protected function deleteFilesRecursively( $directory ) {
}
public function testMigration() {
- $this->migratorMock->loadParamsAndArgs( null, array( 'oldlayout' => 'name', 'newlayout' => 'sha1' ) );
+ $this->migratorMock->loadParamsAndArgs(
+ null,
+ array( 'oldlayout' => 'name', 'newlayout' => 'sha1' )
+ );
ob_start();
. '/'
. $sha1;
- $this->assertEquals( file_get_contents( $expectedOriginalFilepath ), $this->text, 'New sha1 file should be exist and have the right contents' );
+ $this->assertEquals(
+ file_get_contents( $expectedOriginalFilepath ),
+ $this->text,
+ 'New sha1 file should be exist and have the right contents'
+ );
$expectedPublicFilepath = $this->tmpPrefix . '-public/f/f8/Foo.png';
- $this->assertEquals( file_get_contents( $expectedPublicFilepath ), $this->text, 'Existing name file should still and have the right contents' );
+ $this->assertEquals(
+ file_get_contents( $expectedPublicFilepath ),
+ $this->text,
+ 'Existing name file should still and have the right contents'
+ );
}
}
/**
* @dataProvider provider_readerSetFetchColumns
*/
- public function testReaderSetFetchColumns( $message, array $columns, array $primaryKeys, array $fetchColumns ) {
+ public function testReaderSetFetchColumns(
+ $message, array $columns, array $primaryKeys, array $fetchColumns
+ ) {
$db = $this->mockDb();
$db->expects( $this->once() )
->method( 'select' )
- ->with( 'some_table', $columns ) // only testing second parameter of DatabaseBase::select
+ // only testing second parameter of DatabaseBase::select
+ ->with( 'some_table', $columns )
->will( $this->returnValue( new ArrayIterator( array() ) ) );
$reader = new BatchRowIterator( $db, 'some_table', $primaryKeys, 22 );
),
array(
- 'With multiple primary keys the first conditions must use >= and the final condition must use >',
+ 'With multiple primary keys the first conditions ' .
+ 'must use >= and the final condition must use >',
// Expected second iteration
array( "( id_field = '3' AND foo > '103' ) OR ( id_field > '3' )" ),
// Primary key(s)
*
* @dataProvider provider_readerSelectConditions
*/
- public function testReaderSelectConditionsMultiplePrimaryKeys( $message, $expectedSecondIteration, $primaryKeys, $batchSize = 3 ) {
+ public function testReaderSelectConditionsMultiplePrimaryKeys(
+ $message, $expectedSecondIteration, $primaryKeys, $batchSize = 3
+ ) {
$results = $this->genSelectResult( $batchSize, $batchSize * 3, function() {
static $i = 0, $j = 100, $k = 1000;
return array( 'id_field' => ++$i, 'foo' => ++$j, 'bar' => ++$k );