Skip to content

Commit

Permalink
[PATCH] Fixed CS
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed May 10, 2019
1 parent 2c4fb23 commit 761ec2d
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 53 deletions.
48 changes: 24 additions & 24 deletions tests/Block/Service/MatomoStatisticBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ protected function setUp(): void
public function testExecute(): void
{
$client = $this->createMock(ClientInterface::class);
$client->expects($this->once())->method('call')
->with($this->equalTo('VisitsSummary.getVisits'), $this->equalTo([
$client->expects(static::once())->method('call')
->with(static::equalTo('VisitsSummary.getVisits'), static::equalTo([
'idSite' => 'foo',
'period' => 'day',
'date' => 'last30',
]))
->willReturn(['bar'])
;

$this->factory->expects($this->once())->method('createClient')
$this->factory->expects(static::once())->method('createClient')
->willReturn($client)
;

Expand All @@ -68,31 +68,31 @@ public function testExecute(): void
$blockService = new MatomoStatisticBlockService('block.service', $this->templating, $this->factory);
$blockService->execute($blockContext);

$this->assertSame('@Core23Matomo/Block/block_matomo_statistic.html.twig', $this->templating->view);
static::assertSame('@Core23Matomo/Block/block_matomo_statistic.html.twig', $this->templating->view);

$this->assertSame($blockContext, $this->templating->parameters['context']);
$this->assertInternalType('array', $this->templating->parameters['settings']);
$this->assertInstanceOf(BlockInterface::class, $this->templating->parameters['block']);
$this->assertSame(['bar'], $this->templating->parameters['data']);
static::assertSame($blockContext, $this->templating->parameters['context']);
static::assertInternalType('array', $this->templating->parameters['settings']);
static::assertInstanceOf(BlockInterface::class, $this->templating->parameters['block']);
static::assertSame(['bar'], $this->templating->parameters['data']);
}

public function testExecuteOffline(): void
{
$client = $this->createMock(ClientInterface::class);
$client->expects($this->once())->method('call')
->with($this->equalTo('VisitsSummary.getVisits'), $this->equalTo([
$client->expects(static::once())->method('call')
->with(static::equalTo('VisitsSummary.getVisits'), static::equalTo([
'idSite' => 'foo',
'period' => 'day',
'date' => 'last30',
]))
->willThrowException(new MatomoException('Offline'))
;

$this->factory->expects($this->once())->method('createClient')
$this->factory->expects(static::once())->method('createClient')
->willReturn($client)
;

$this->logger->expects($this->once())->method('warning');
$this->logger->expects(static::once())->method('warning');

$block = new Block();

Expand All @@ -111,12 +111,12 @@ public function testExecuteOffline(): void
$blockService->setLogger($this->logger);
$blockService->execute($blockContext);

$this->assertSame('@Core23Matomo/Block/block_matomo_statistic.html.twig', $this->templating->view);
static::assertSame('@Core23Matomo/Block/block_matomo_statistic.html.twig', $this->templating->view);

$this->assertSame($blockContext, $this->templating->parameters['context']);
$this->assertInternalType('array', $this->templating->parameters['settings']);
$this->assertInstanceOf(BlockInterface::class, $this->templating->parameters['block']);
$this->assertNull($this->templating->parameters['data']);
static::assertSame($blockContext, $this->templating->parameters['context']);
static::assertInternalType('array', $this->templating->parameters['settings']);
static::assertInstanceOf(BlockInterface::class, $this->templating->parameters['block']);
static::assertNull($this->templating->parameters['data']);
}

public function testDefaultSettings(): void
Expand Down Expand Up @@ -146,12 +146,12 @@ public function testGetBlockMetadata(): void

$metadata = $blockService->getBlockMetadata('description');

$this->assertSame('block.service', $metadata->getTitle());
$this->assertSame('description', $metadata->getDescription());
$this->assertNotNull($metadata->getImage());
$this->assertStringStartsWith('data:image/png;base64,', $metadata->getImage() ?? '');
$this->assertSame('Core23MatomoBundle', $metadata->getDomain());
$this->assertSame([
static::assertSame('block.service', $metadata->getTitle());
static::assertSame('description', $metadata->getDescription());
static::assertNotNull($metadata->getImage());
static::assertStringStartsWith('data:image/png;base64,', $metadata->getImage() ?? '');
static::assertSame('Core23MatomoBundle', $metadata->getDomain());
static::assertSame([
'class' => 'fa fa-area-chart',
], $metadata->getOptions());
}
Expand All @@ -163,7 +163,7 @@ public function testBuildEditForm(): void
$block = new Block();

$formMapper = $this->createMock(FormMapper::class);
$formMapper->expects($this->once())->method('add');
$formMapper->expects(static::once())->method('add');

$blockService->buildEditForm($formMapper, $block);
}
Expand Down
22 changes: 11 additions & 11 deletions tests/Block/Service/MatomoTrackerBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public function testExecute(): void
$blockService = new MatomoTrackerBlockService('block.service', $this->templating);
$blockService->execute($blockContext);

$this->assertSame('@Core23Matomo/Block/block_matomo_tracker.html.twig', $this->templating->view);
static::assertSame('@Core23Matomo/Block/block_matomo_tracker.html.twig', $this->templating->view);

$this->assertSame($blockContext, $this->templating->parameters['context']);
$this->assertInternalType('array', $this->templating->parameters['settings']);
$this->assertInstanceOf(BlockInterface::class, $this->templating->parameters['block']);
static::assertSame($blockContext, $this->templating->parameters['context']);
static::assertInternalType('array', $this->templating->parameters['settings']);
static::assertInstanceOf(BlockInterface::class, $this->templating->parameters['block']);
}

public function testDefaultSettings(): void
Expand All @@ -64,12 +64,12 @@ public function testGetBlockMetadata(): void

$metadata = $blockService->getBlockMetadata('description');

$this->assertSame('block.service', $metadata->getTitle());
$this->assertSame('description', $metadata->getDescription());
$this->assertNotNull($metadata->getImage());
$this->assertStringStartsWith('data:image/png;base64,', $metadata->getImage() ?? '');
$this->assertSame('Core23MatomoBundle', $metadata->getDomain());
$this->assertSame([
static::assertSame('block.service', $metadata->getTitle());
static::assertSame('description', $metadata->getDescription());
static::assertNotNull($metadata->getImage());
static::assertStringStartsWith('data:image/png;base64,', $metadata->getImage() ?? '');
static::assertSame('Core23MatomoBundle', $metadata->getDomain());
static::assertSame([
'class' => 'fa fa-code',
], $metadata->getOptions());
}
Expand All @@ -81,7 +81,7 @@ public function testBuildEditForm(): void
$block = new Block();

$formMapper = $this->createMock(FormMapper::class);
$formMapper->expects($this->once())->method('add');
$formMapper->expects(static::once())->method('add');

$blockService->buildEditForm($formMapper, $block);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Client/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public function testItIsInstantiable(): void
{
$client = new Client($this->connection->reveal());

$this->assertInstanceOf(ClientInterface::class, $client);
static::assertInstanceOf(ClientInterface::class, $client);
}

public function testGetConnection(): void
{
$client = new Client($this->connection->reveal());

$this->assertSame($this->connection->reveal(), $client->getConnection());
static::assertSame($this->connection->reveal(), $client->getConnection());
}

public function testCall(): void
Expand All @@ -52,7 +52,7 @@ public function testCall(): void
$client = new Client($this->connection->reveal(), 'MY_TOKEN');
$result = $client->call('foo/method', ['foo' => 'bar']);

$this->assertSame(['result' => 'data'], $result);
static::assertSame(['result' => 'data'], $result);
}

public function testCallWithCustomFormat(): void
Expand All @@ -69,7 +69,7 @@ public function testCallWithCustomFormat(): void
$client = new Client($this->connection->reveal(), 'MY_TOKEN');
$result = $client->call('foo/method', ['foo' => 'bar'], 'custom');

$this->assertSame('The result', $result);
static::assertSame('The result', $result);
}

public function testCallWithApiError(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/Client/HttplugClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public function testItIsInstantiable(): void
{
$factory = new HttplugClientFactory($this->client->reveal(), $this->messageFactory->reveal());

$this->assertInstanceOf(ClientFactoryInterface::class, $factory);
static::assertInstanceOf(ClientFactoryInterface::class, $factory);
}

public function testGetConnection(): void
{
$factory = new HttplugClientFactory($this->client->reveal(), $this->messageFactory->reveal());

$this->assertInstanceOf(ClientInterface::class, $factory->createClient('http://localhost', 'MY_TOKEN'));
static::assertInstanceOf(ClientInterface::class, $factory->createClient('http://localhost', 'MY_TOKEN'));
}
}
10 changes: 5 additions & 5 deletions tests/Connection/HttplugConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testItIsInstantiable(): void
{
$client = new HttplugConnection($this->client->reveal(), $this->messageFactory->reveal(), 'http://api.url');

$this->assertInstanceOf(ConnectionInterface::class, $client);
static::assertInstanceOf(ConnectionInterface::class, $client);
}

public function testSend(): void
Expand All @@ -58,7 +58,7 @@ public function testSend(): void
->willReturn($response)
;

$this->assertSame('my content', $client->send(['foo' => 'bar']));
static::assertSame('my content', $client->send(['foo' => 'bar']));
}

public function testSendWithDateParameter(): void
Expand All @@ -77,7 +77,7 @@ public function testSendWithDateParameter(): void
->willReturn($response)
;

$this->assertSame('my content', $client->send(['date' => new DateTime('2010-02-10')]));
static::assertSame('my content', $client->send(['date' => new DateTime('2010-02-10')]));
}

public function testSendWithBooleanParameter(): void
Expand All @@ -96,7 +96,7 @@ public function testSendWithBooleanParameter(): void
->willReturn($response)
;

$this->assertSame('my content', $client->send(['active' => true, 'inactive' => false]));
static::assertSame('my content', $client->send(['active' => true, 'inactive' => false]));
}

public function testSendWithArrayParameter(): void
Expand All @@ -115,7 +115,7 @@ public function testSendWithArrayParameter(): void
->willReturn($response)
;

$this->assertSame('my content', $client->send(['foo' => ['bar', 'baz']]));
static::assertSame('my content', $client->send(['foo' => ['bar', 'baz']]));
}

public function testSendWithException(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Core23MatomoBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public function testItIsInstantiable(): void
{
$bundle = new Core23MatomoBundle();

$this->assertInstanceOf(BundleInterface::class, $bundle);
static::assertInstanceOf(BundleInterface::class, $bundle);
}
}
2 changes: 1 addition & 1 deletion tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public function testOptions(): void
],
];

$this->assertSame($expected, $config);
static::assertSame($expected, $config);
}
}
10 changes: 5 additions & 5 deletions tests/Twig/Extension/MatomoTwigExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public function testGetFunctions(): void

$functions = $extension->getFunctions();

$this->assertCount(1, $functions);
static::assertCount(1, $functions);

foreach ($functions as $function) {
$this->assertInstanceOf(TwigFunction::class, $function);
$this->assertIsCallable($function->getCallable());
static::assertInstanceOf(TwigFunction::class, $function);
static::assertIsCallable($function->getCallable());
}
}

Expand All @@ -53,7 +53,7 @@ public function testRenderTracker(): void

$extension = new MatomoTwigExtension($this->environment->reveal());

$this->assertSame('HTML CONTENT', $extension->renderTracker([
static::assertSame('HTML CONTENT', $extension->renderTracker([
'site_id' => 13,
]));
}
Expand All @@ -66,6 +66,6 @@ public function testRenderTrackerWithoutSiteId(): void
->shouldNotBeCalled()
;

$this->assertSame('', $extension->renderTracker());
static::assertSame('', $extension->renderTracker());
}
}

0 comments on commit 761ec2d

Please sign in to comment.