* @covers ZipDirectoryReader
* NOTE: this test is more like an integration test than a unit test
*/
-class ZipDirectoryReaderTest extends MediaWikiTestCase {
+class ZipDirectoryReaderTest extends PHPUnit_Framework_TestCase {
protected $zipDir;
protected $entries;
}
function readZipAssertError( $file, $error, $assertMessage ) {
- $this->entries = array();
- $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", array( $this, 'zipCallback' ) );
+ $this->entries = [];
+ $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", [ $this, 'zipCallback' ] );
$this->assertTrue( $status->hasMessage( $error ), $assertMessage );
}
function readZipAssertSuccess( $file, $assertMessage ) {
- $this->entries = array();
- $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", array( $this, 'zipCallback' ) );
+ $this->entries = [];
+ $status = ZipDirectoryReader::read( "{$this->zipDir}/$file", [ $this, 'zipCallback' ] );
$this->assertTrue( $status->isOK(), $assertMessage );
}
public function testSimple() {
$this->readZipAssertSuccess( 'class.zip', 'Simple ZIP' );
- $this->assertEquals( $this->entries, array( array(
+ $this->assertEquals( $this->entries, [ [
'name' => 'Class.class',
'mtime' => '20010115000000',
'size' => 1,
- ) ) );
+ ] ] );
}
public function testBadCentralEntrySignature() {
'Wrong CD start disk error' );
}
-
public function testCentralDirectoryGap() {
$this->readZipAssertError( 'cd-gap.zip', 'zip-bad',
'CD gap error' );