Skip to content

Commit

Permalink
Merge pull request #8877 from greg0ire/3.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire authored Aug 3, 2021
2 parents e338738 + e51f0ce commit d7a5eab
Show file tree
Hide file tree
Showing 386 changed files with 7,756 additions and 7,756 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public function checkNoDeprecationMessageWhenNumberAwareEnabled(): void

$after = Deprecation::getTriggeredDeprecations()['https://github.com/doctrine/orm/pull/7908'] ?? 0;

$this->assertSame($before, $after);
self::assertSame($before, $after);
}
}
20 changes: 10 additions & 10 deletions tests/Doctrine/Tests/ORM/Cache/AbstractRegionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,38 @@ public static function dataProviderCacheValues(): array
*/
public function testPutGetContainsEvict($key, $value): void
{
$this->assertFalse($this->region->contains($key));
self::assertFalse($this->region->contains($key));

$this->region->put($key, $value);

$this->assertTrue($this->region->contains($key));
self::assertTrue($this->region->contains($key));

$actual = $this->region->get($key);

$this->assertEquals($value, $actual);
self::assertEquals($value, $actual);

$this->region->evict($key);

$this->assertFalse($this->region->contains($key));
self::assertFalse($this->region->contains($key));
}

public function testEvictAll(): void
{
$key1 = new CacheKeyMock('key.1');
$key2 = new CacheKeyMock('key.2');

$this->assertFalse($this->region->contains($key1));
$this->assertFalse($this->region->contains($key2));
self::assertFalse($this->region->contains($key1));
self::assertFalse($this->region->contains($key2));

$this->region->put($key1, new CacheEntryMock(['value' => 'foo']));
$this->region->put($key2, new CacheEntryMock(['value' => 'bar']));

$this->assertTrue($this->region->contains($key1));
$this->assertTrue($this->region->contains($key2));
self::assertTrue($this->region->contains($key1));
self::assertTrue($this->region->contains($key2));

$this->region->evictAll();

$this->assertFalse($this->region->contains($key1));
$this->assertFalse($this->region->contains($key2));
self::assertFalse($this->region->contains($key1));
self::assertFalse($this->region->contains($key2));
}
}
16 changes: 8 additions & 8 deletions tests/Doctrine/Tests/ORM/Cache/CacheConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,33 @@ public function testSetGetRegionLifetime(): void

$config->setDefaultLifetime(111);

$this->assertEquals($config->getDefaultLifetime(), $config->getLifetime('foo_region'));
self::assertEquals($config->getDefaultLifetime(), $config->getLifetime('foo_region'));

$config->setLifetime('foo_region', 222);

$this->assertEquals(222, $config->getLifetime('foo_region'));
self::assertEquals(222, $config->getLifetime('foo_region'));
}

public function testSetGetCacheLogger(): void
{
$logger = $this->createMock(CacheLogger::class);

$this->assertNull($this->config->getCacheLogger());
self::assertNull($this->config->getCacheLogger());

$this->config->setCacheLogger($logger);

$this->assertEquals($logger, $this->config->getCacheLogger());
self::assertEquals($logger, $this->config->getCacheLogger());
}

public function testSetGetCacheFactory(): void
{
$factory = $this->createMock(CacheFactory::class);

$this->assertNull($this->config->getCacheFactory());
self::assertNull($this->config->getCacheFactory());

$this->config->setCacheFactory($factory);

$this->assertEquals($factory, $this->config->getCacheFactory());
self::assertEquals($factory, $this->config->getCacheFactory());
}

public function testSetGetQueryValidator(): void
Expand All @@ -72,10 +72,10 @@ public function testSetGetQueryValidator(): void

$validator = $this->createMock(QueryCacheValidator::class);

$this->assertInstanceOf(TimestampQueryCacheValidator::class, $this->config->getQueryValidator());
self::assertInstanceOf(TimestampQueryCacheValidator::class, $this->config->getQueryValidator());

$this->config->setQueryValidator($validator);

$this->assertEquals($validator, $this->config->getQueryValidator());
self::assertEquals($validator, $this->config->getQueryValidator());
}
}
14 changes: 7 additions & 7 deletions tests/Doctrine/Tests/ORM/Cache/CacheKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,54 +18,54 @@ public function testEntityCacheKeyIdentifierCollision(): void
$key1 = new EntityCacheKey('Foo', ['id' => 1]);
$key2 = new EntityCacheKey('Bar', ['id' => 1]);

$this->assertNotEquals($key1->hash, $key2->hash);
self::assertNotEquals($key1->hash, $key2->hash);
}

public function testEntityCacheKeyIdentifierType(): void
{
$key1 = new EntityCacheKey('Foo', ['id' => 1]);
$key2 = new EntityCacheKey('Foo', ['id' => '1']);

$this->assertEquals($key1->hash, $key2->hash);
self::assertEquals($key1->hash, $key2->hash);
}

public function testEntityCacheKeyIdentifierOrder(): void
{
$key1 = new EntityCacheKey('Foo', ['foo_bar' => 1, 'bar_foo' => 2]);
$key2 = new EntityCacheKey('Foo', ['bar_foo' => 2, 'foo_bar' => 1]);

$this->assertEquals($key1->hash, $key2->hash);
self::assertEquals($key1->hash, $key2->hash);
}

public function testCollectionCacheKeyIdentifierType(): void
{
$key1 = new CollectionCacheKey('Foo', 'assoc', ['id' => 1]);
$key2 = new CollectionCacheKey('Foo', 'assoc', ['id' => '1']);

$this->assertEquals($key1->hash, $key2->hash);
self::assertEquals($key1->hash, $key2->hash);
}

public function testCollectionCacheKeyIdentifierOrder(): void
{
$key1 = new CollectionCacheKey('Foo', 'assoc', ['foo_bar' => 1, 'bar_foo' => 2]);
$key2 = new CollectionCacheKey('Foo', 'assoc', ['bar_foo' => 2, 'foo_bar' => 1]);

$this->assertEquals($key1->hash, $key2->hash);
self::assertEquals($key1->hash, $key2->hash);
}

public function testCollectionCacheKeyIdentifierCollision(): void
{
$key1 = new CollectionCacheKey('Foo', 'assoc', ['id' => 1]);
$key2 = new CollectionCacheKey('Bar', 'assoc', ['id' => 1]);

$this->assertNotEquals($key1->hash, $key2->hash);
self::assertNotEquals($key1->hash, $key2->hash);
}

public function testCollectionCacheKeyAssociationCollision(): void
{
$key1 = new CollectionCacheKey('Foo', 'assoc1', ['id' => 1]);
$key2 = new CollectionCacheKey('Foo', 'assoc2', ['id' => 1]);

$this->assertNotEquals($key1->hash, $key2->hash);
self::assertNotEquals($key1->hash, $key2->hash);
}
}
44 changes: 22 additions & 22 deletions tests/Doctrine/Tests/ORM/Cache/CacheLoggerChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ protected function setUp(): void

public function testGetAndSetLogger(): void
{
$this->assertEmpty($this->logger->getLoggers());
self::assertEmpty($this->logger->getLoggers());

$this->assertNull($this->logger->getLogger('mock'));
self::assertNull($this->logger->getLogger('mock'));

$this->logger->setLogger('mock', $this->mock);

$this->assertSame($this->mock, $this->logger->getLogger('mock'));
$this->assertEquals(['mock' => $this->mock], $this->logger->getLoggers());
self::assertSame($this->mock, $this->logger->getLogger('mock'));
self::assertEquals(['mock' => $this->mock], $this->logger->getLoggers());
}

public function testEntityCacheChain(): void
Expand All @@ -51,17 +51,17 @@ public function testEntityCacheChain(): void

$this->logger->setLogger('mock', $this->mock);

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('entityCacheHit')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('entityCachePut')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('entityCacheMiss')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->logger->entityCacheHit($name, $key);
$this->logger->entityCachePut($name, $key);
Expand All @@ -75,17 +75,17 @@ public function testCollectionCacheChain(): void

$this->logger->setLogger('mock', $this->mock);

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('collectionCacheHit')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('collectionCachePut')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('collectionCacheMiss')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->logger->collectionCacheHit($name, $key);
$this->logger->collectionCachePut($name, $key);
Expand All @@ -99,17 +99,17 @@ public function testQueryCacheChain(): void

$this->logger->setLogger('mock', $this->mock);

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('queryCacheHit')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('queryCachePut')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->mock->expects($this->once())
$this->mock->expects(self::once())
->method('queryCacheMiss')
->with($this->equalTo($name), $this->equalTo($key));
->with(self::equalTo($name), self::equalTo($key));

$this->logger->queryCacheHit($name, $key);
$this->logger->queryCachePut($name, $key);
Expand Down
Loading

0 comments on commit d7a5eab

Please sign in to comment.