Fix wrong $this->assert...() with `self::assert...()

This commit is contained in:
Philipp
2020-10-17 14:19:57 +02:00
parent b3e5621d37
commit efaec26b1d
63 changed files with 1192 additions and 1192 deletions
@@ -66,6 +66,6 @@ class DatabaseStorageTest extends StorageTest
protected function assertOption(IStorage $storage)
{
$this->assertEmpty($storage->getOptions());
self::assertEmpty($storage->getOptions());
}
}
@@ -66,7 +66,7 @@ class FilesystemStorageTest extends StorageTest
protected function assertOption(IStorage $storage)
{
$this->assertEquals([
self::assertEquals([
'storagepath' => [
'input', 'Storage base path',
$this->root->getChild('storage')->url(),
@@ -119,12 +119,12 @@ class FilesystemStorageTest extends StorageTest
$dir = $this->root->getChild('storage/f0/c0')->url();
$file = $this->root->getChild('storage/f0/c0/d0i0')->url();
$this->assertDirectoryExists($dir);
$this->assertFileExists($file);
self::assertDirectoryExists($dir);
self::assertFileExists($file);
$this->assertDirectoryIsWritable($dir);
$this->assertFileIsWritable($file);
self::assertDirectoryIsWritable($dir);
self::assertFileIsWritable($file);
$this->assertEquals('test', file_get_contents($file));
self::assertEquals('test', file_get_contents($file));
}
}
+11 -11
View File
@@ -37,7 +37,7 @@ abstract class StorageTest extends MockedTest
public function testInstance()
{
$instance = $this->getInstance();
$this->assertInstanceOf(IStorage::class, $instance);
self::assertInstanceOf(IStorage::class, $instance);
}
/**
@@ -58,11 +58,11 @@ abstract class StorageTest extends MockedTest
$instance = $this->getInstance();
$ref = $instance->put('data12345');
$this->assertNotEmpty($ref);
self::assertNotEmpty($ref);
$this->assertEquals('data12345', $instance->get($ref));
self::assertEquals('data12345', $instance->get($ref));
$this->assertTrue($instance->delete($ref));
self::assertTrue($instance->delete($ref));
}
/**
@@ -73,7 +73,7 @@ abstract class StorageTest extends MockedTest
$instance = $this->getInstance();
// Even deleting not existing references should return "true"
$this->assertTrue($instance->delete(-1234456));
self::assertTrue($instance->delete(-1234456));
}
/**
@@ -84,7 +84,7 @@ abstract class StorageTest extends MockedTest
$instance = $this->getInstance();
// Invalid references return an empty string
$this->assertEmpty($instance->get(-123456));
self::assertEmpty($instance->get(-123456));
}
/**
@@ -95,12 +95,12 @@ abstract class StorageTest extends MockedTest
$instance = $this->getInstance();
$ref = $instance->put('data12345');
$this->assertNotEmpty($ref);
self::assertNotEmpty($ref);
$this->assertEquals('data12345', $instance->get($ref));
self::assertEquals('data12345', $instance->get($ref));
$this->assertEquals($ref, $instance->put('data5432', $ref));
$this->assertEquals('data5432', $instance->get($ref));
self::assertEquals($ref, $instance->put('data5432', $ref));
self::assertEquals('data5432', $instance->get($ref));
}
/**
@@ -110,6 +110,6 @@ abstract class StorageTest extends MockedTest
{
$instance = $this->getInstance();
$this->assertEquals(-123, $instance->put('data12345', -123));
self::assertEquals(-123, $instance->put('data12345', -123));
}
}