Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Commit

Permalink
Merge d4cc44e into 02e0328
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed May 10, 2019
2 parents 02e0328 + d4cc44e commit 9b898bb
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 41 deletions.
7 changes: 4 additions & 3 deletions .gitattributes
@@ -1,6 +1,7 @@
.* export-ignore
Makefile export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
docs/* export-ignore
tests/* export-ignore
vendor-bin/ export-ignore
/docs export-ignore
/tests export-ignore
/vendor-bin export-ignore
4 changes: 2 additions & 2 deletions src/Test/AbstractSitemapServiceTestCase.php
Expand Up @@ -56,7 +56,7 @@ final protected function process(SitemapDefinitionInterface $sitemap): void
$result = $this->service->execute($sitemap);

$count = \count($this->urls);
$this->assertCount($count, $result);
static::assertCount($count, $result);

if (0 === $count) {
return;
Expand Down Expand Up @@ -101,7 +101,7 @@ final protected function assertSitemap(string $location, int $priority, string $
*/
final protected function assertSitemapCount(int $count): void
{
$this->assertCount($count, $this->urls);
static::assertCount($count, $this->urls);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Action/SitemapXMLActionTest.php
Expand Up @@ -26,7 +26,7 @@ public function testExecute(): void

$response = $action();

$this->assertSame('text/xml', $response->headers->get('Content-Type'));
$this->assertSame('<xml></xml>', $response->getContent());
static::assertSame('text/xml', $response->headers->get('Content-Type'));
static::assertSame('<xml></xml>', $response->getContent());
}
}
6 changes: 3 additions & 3 deletions tests/Core23SitemapBundleTest.php
Expand Up @@ -20,15 +20,15 @@ public function testItIsInstantiable(): void
{
$bundle = new Core23SitemapBundle();

$this->assertInstanceOf(Core23SitemapBundle::class, $bundle);
static::assertInstanceOf(Core23SitemapBundle::class, $bundle);
}

public function testBuild(): void
{
$containerBuilder = $this->createMock(ContainerBuilder::class);

$containerBuilder->expects($this->once())->method('addCompilerPass')
->with($this->isInstanceOf(SitemapCompilerPass::class))
$containerBuilder->expects(static::once())->method('addCompilerPass')
->with(static::isInstanceOf(SitemapCompilerPass::class))
;

$bundle = new Core23SitemapBundle();
Expand Down
8 changes: 4 additions & 4 deletions tests/Definition/DefinitionManagerTest.php
Expand Up @@ -20,7 +20,7 @@ public function testItIsInstantiable(): void
{
$definition = new DefintionManager();

$this->assertInstanceOf(DefintionManagerInterface::class, $definition);
static::assertInstanceOf(DefintionManagerInterface::class, $definition);
}

public function testAddDefintion(): void
Expand All @@ -31,9 +31,9 @@ public function testAddDefintion(): void
]);

foreach ($definition->getAll() as $id => $item) {
$this->assertInstanceOf(SitemapDefinition::class, $item);
$this->assertSame('foo.definition', $id);
$this->assertSame([
static::assertInstanceOf(SitemapDefinition::class, $item);
static::assertSame('foo.definition', $id);
static::assertSame([
'foo' => 'bar',
], $item->getSettings());
}
Expand Down
20 changes: 10 additions & 10 deletions tests/Definition/SitemapDefintionTest.php
Expand Up @@ -19,11 +19,11 @@ public function testItIsInstantiable(): void
{
$definition = new SitemapDefinition('acme.sitemap');

$this->assertInstanceOf(SitemapDefinitionInterface::class, $definition);
$this->assertSame('acme.sitemap', $definition->getType());
$this->assertSame('acme.sitemap', $definition->toString());
$this->assertSame('acme.sitemap', $definition->__toString());
$this->assertSame([], $definition->getSettings());
static::assertInstanceOf(SitemapDefinitionInterface::class, $definition);
static::assertSame('acme.sitemap', $definition->getType());
static::assertSame('acme.sitemap', $definition->toString());
static::assertSame('acme.sitemap', $definition->__toString());
static::assertSame([], $definition->getSettings());
}

public function testSetting(): void
Expand All @@ -33,14 +33,14 @@ public function testSetting(): void
'foo'=> 'bar',
]);

$this->assertSame('bar', $definition->getSetting('foo'));
static::assertSame('bar', $definition->getSetting('foo'));
}

public function testSettingWithDefault(): void
{
$definition = new SitemapDefinition('acme.sitemap');

$this->assertSame('baz', $definition->getSetting('foo', 'baz'));
static::assertSame('baz', $definition->getSetting('foo', 'baz'));
}

public function testTtl(): void
Expand All @@ -50,7 +50,7 @@ public function testTtl(): void
'ttl' => 90,
]);

$this->assertSame(90, $definition->getTtl());
static::assertSame(90, $definition->getTtl());
}

public function testTtlWithoutCache(): void
Expand All @@ -59,13 +59,13 @@ public function testTtlWithoutCache(): void
'use_cache' => false,
]);

$this->assertSame(0, $definition->getTtl());
static::assertSame(0, $definition->getTtl());
}

public function testTtlDefault(): void
{
$definition = new SitemapDefinition('acme.sitemap');

$this->assertSame(0, $definition->getTtl());
static::assertSame(0, $definition->getTtl());
}
}
Expand Up @@ -69,7 +69,7 @@ public function testProcess(): void
$compiler = new SitemapCompilerPass();
$compiler->process($this->container);

$this->assertTrue($sitemapDefinition->isPublic());
static::assertTrue($sitemapDefinition->isPublic());
}

public function testProcessWithNoServices(): void
Expand All @@ -79,7 +79,7 @@ public function testProcessWithNoServices(): void
$compiler = new SitemapCompilerPass();
$compiler->process($this->container);

$this->assertTrue(true);
static::assertTrue(true);
}

public function testProcessWithStaticUrls(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/DependencyInjection/ConfigurationTest.php
Expand Up @@ -30,7 +30,7 @@ public function testOptions(): void
],
];

$this->assertSame($expected, $config);
static::assertSame($expected, $config);
}

public function testCronOptions(): void
Expand Down Expand Up @@ -63,6 +63,6 @@ public function testCronOptions(): void
],
];

$this->assertArraySubset($expected, $config);
static::assertArraySubset($expected, $config);
}
}
2 changes: 1 addition & 1 deletion tests/Exception/SitemapNotFoundExceptionTest.php
Expand Up @@ -19,6 +19,6 @@ public function testItIsInstantiable(): void
{
$exception = new SitemapNotFoundException();

$this->assertInstanceOf(Throwable::class, $exception);
static::assertInstanceOf(Throwable::class, $exception);
}
}
12 changes: 6 additions & 6 deletions tests/Generator/SitemapGeneratorTest.php
Expand Up @@ -48,7 +48,7 @@ public function testItIsInstantiable(): void
$this->defintionManager->reveal()
);

$this->assertInstanceOf(SitemapGeneratorInterface::class, $generator);
static::assertInstanceOf(SitemapGeneratorInterface::class, $generator);
}

public function testToXMLWithInvalidDefinition(): void
Expand Down Expand Up @@ -76,7 +76,7 @@ public function testToXMLWithInvalidDefinition(): void
$this->defintionManager->reveal()
);

$this->assertSame($expected, $generator->toXML());
static::assertSame($expected, $generator->toXML());
}

public function testToXMLWithNoEntries(): void
Expand All @@ -96,7 +96,7 @@ public function testToXMLWithNoEntries(): void
$this->defintionManager->reveal()
);

$this->assertSame($expected, $generator->toXML());
static::assertSame($expected, $generator->toXML());
}

public function testToXML(): void
Expand Down Expand Up @@ -146,7 +146,7 @@ public function testToXML(): void
$this->defintionManager->reveal()
);

$this->assertSame($expected, $generator->toXML());
static::assertSame($expected, $generator->toXML());
}

public function testToXMLWithExistingCache(): void
Expand Down Expand Up @@ -205,7 +205,7 @@ public function testToXMLWithExistingCache(): void
$cache->reveal()
);

$this->assertSame($expected, $generator->toXML());
static::assertSame($expected, $generator->toXML());
}

public function testToXMLWithExpiredCache(): void
Expand Down Expand Up @@ -269,7 +269,7 @@ public function testToXMLWithExpiredCache(): void
$cache->reveal()
);

$this->assertSame($expected, $generator->toXML());
static::assertSame($expected, $generator->toXML());
}

public function testToXMLWithCacheException(): void
Expand Down
12 changes: 6 additions & 6 deletions tests/Sitemap/SitemapServiceManagerTest.php
Expand Up @@ -27,7 +27,7 @@ public function testItIsInstantiable(): void
{
$manager = new SitemapServiceManager();

$this->assertInstanceOf(SitemapServiceManagerInterface::class, $manager);
static::assertInstanceOf(SitemapServiceManagerInterface::class, $manager);
}

public function testCreationWithInvalidServices(): void
Expand All @@ -51,8 +51,8 @@ public function testGet(): void
]);
$result = $manager->get($definition);

$this->assertInstanceOf(SitemapServiceInterface::class, $result);
$this->assertSame([
static::assertInstanceOf(SitemapServiceInterface::class, $result);
static::assertSame([
'custom' => 'foo',
'use_cache' => true,
'extra_cache_keys' => [],
Expand All @@ -76,8 +76,8 @@ public function testGetWithOverride(): void
]);
$result = $manager->get($definition);

$this->assertInstanceOf(SitemapServiceInterface::class, $result);
$this->assertSame([
static::assertInstanceOf(SitemapServiceInterface::class, $result);
static::assertSame([
'use_cache' => false,
'extra_cache_keys' => ['my-key'],
'ttl' => 0,
Expand Down Expand Up @@ -126,6 +126,6 @@ public function testAddSitemap(): void
$manager = new SitemapServiceManager();
$manager->addSitemap('my-type', $service->reveal());

$this->assertTrue(true);
static::assertTrue(true);
}
}

0 comments on commit 9b898bb

Please sign in to comment.