Skip to content

Enhancement: Apply void_return fixer to tests #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/Functional/DiscoveredClientsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class DiscoveredClientsTest extends WebTestCase
{
public function testDiscoveredClient()
public function testDiscoveredClient(): void
{
$container = $this->getContainer(false);

Expand All @@ -26,7 +26,7 @@ public function testDiscoveredClient()
$this->assertInstanceOf(HttpClient::class, $service);
}

public function testDiscoveredAsyncClient()
public function testDiscoveredAsyncClient(): void
{
$container = $this->getContainer(false);

Expand All @@ -37,7 +37,7 @@ public function testDiscoveredAsyncClient()
$this->assertInstanceOf(HttpAsyncClient::class, $service);
}

public function testDiscoveredClientWithProfilingEnabled()
public function testDiscoveredClientWithProfilingEnabled(): void
{
$container = $this->getContainer(true);

Expand All @@ -49,7 +49,7 @@ public function testDiscoveredClientWithProfilingEnabled()
$this->assertInstanceOf(HttpClient::class, NSA::getProperty($service, 'client'));
}

public function testDiscoveredAsyncClientWithProfilingEnabled()
public function testDiscoveredAsyncClientWithProfilingEnabled(): void
{
$container = $this->getContainer(true);

Expand All @@ -64,7 +64,7 @@ public function testDiscoveredAsyncClientWithProfilingEnabled()
/**
* Test with httplug.discovery.client: "auto".
*/
public function testDiscovery()
public function testDiscovery(): void
{
$container = $this->getContainer(true);

Expand All @@ -86,7 +86,7 @@ public function testDiscovery()
/**
* Test with httplug.discovery.client: null.
*/
public function testDisabledDiscovery()
public function testDisabledDiscovery(): void
{
$container = $this->getContainer(true, 'discovery_disabled');

Expand All @@ -98,7 +98,7 @@ public function testDisabledDiscovery()
/**
* Test with httplug.discovery.client: "httplug.client.acme".
*/
public function testForcedDiscovery()
public function testForcedDiscovery(): void
{
$container = $this->getContainer(true, 'discovery_forced');

Expand All @@ -119,7 +119,7 @@ private function getContainer($debug, $environment = 'test')
return static::$kernel->getContainer();
}

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down
12 changes: 6 additions & 6 deletions tests/Functional/DiscoveryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
final class DiscoveryTest extends AbstractExtensionTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand All @@ -37,7 +37,7 @@ protected function getContainerExtensions()
];
}

public function testDiscoveryFallbacks()
public function testDiscoveryFallbacks(): void
{
$this->load();

Expand All @@ -48,7 +48,7 @@ public function testDiscoveryFallbacks()
$this->assertContainerBuilderHasService('httplug.async_client.default', HttpAsyncClient::class);
}

public function testDiscoveryPartialFallbacks()
public function testDiscoveryPartialFallbacks(): void
{
$this->load();
$this->setDefinition('httplug.client.default', new Definition(Client::class));
Expand All @@ -60,7 +60,7 @@ public function testDiscoveryPartialFallbacks()
$this->assertContainerBuilderHasService('httplug.async_client.default', HttpAsyncClient::class);
}

public function testNoDiscoveryFallbacks()
public function testNoDiscoveryFallbacks(): void
{
$this->setDefinition('httplug.client.default', new Definition(HttpClient::class));
$this->setDefinition('httplug.message_factory.default', new Definition(MessageFactory::class));
Expand All @@ -75,7 +75,7 @@ public function testNoDiscoveryFallbacks()
$this->assertEquals([HttpClientDiscovery::class, 'find'], $clientDefinition->getFactory());
}

public function testEnableAutowiring()
public function testEnableAutowiring(): void
{
$this->load([
'default_client_autowiring' => true,
Expand All @@ -87,7 +87,7 @@ public function testEnableAutowiring()
$this->assertContainerBuilderHasAlias(HttpAsyncClient::class);
}

public function testDisableAutowiring()
public function testDisableAutowiring(): void
{
if (PHP_VERSION_ID <= 70000) {
$this->markTestSkipped();
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Issue206.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class Issue206 extends WebTestCase
{
public function testCustomClientDoesNotCauseException()
public function testCustomClientDoesNotCauseException(): void
{
static::bootKernel();
$container = static::$kernel->getContainer();
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class ProfilerTest extends WebTestCase
{
public function testShowProfiler()
public function testShowProfiler(): void
{
$client = static::createClient();

Expand Down
10 changes: 5 additions & 5 deletions tests/Functional/ProfilingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class ProfilingTest extends TestCase
*/
private $stopwatch;

public function setUp()
public function setUp(): void
{
$this->collector = new Collector([]);
$this->formatter = new Formatter(new FullHttpMessageFormatter(), new CurlCommandFormatter());
$this->stopwatch = new Stopwatch();
}

public function testProfilingWithCachePlugin()
public function testProfilingWithCachePlugin(): void
{
$client = $this->createClient([
new Plugin\CachePlugin(new ArrayAdapter(), StreamFactoryDiscovery::find(), [
Expand All @@ -64,7 +64,7 @@ public function testProfilingWithCachePlugin()
$this->assertEquals('example.com', $stack->getRequestHost());
}

public function testProfilingWhenPluginThrowException()
public function testProfilingWhenPluginThrowException(): void
{
$client = $this->createClient([
new ExceptionThrowerPlugin(),
Expand All @@ -83,7 +83,7 @@ public function testProfilingWhenPluginThrowException()
}
}

public function testProfiling()
public function testProfiling(): void
{
$client = $this->createClient([
new Plugin\AddHostPlugin(UriFactoryDiscovery::find()->createUri('https://example.com')),
Expand Down Expand Up @@ -122,7 +122,7 @@ class ExceptionThrowerPlugin implements Plugin
{
use Plugin\VersionBridgePlugin;

protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first): void
{
throw new \Exception();
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Functional/ServiceInstantiationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class ServiceInstantiationTest extends WebTestCase
{
public function testHttpClient()
public function testHttpClient(): void
{
static::bootKernel();
$container = static::$kernel->getContainer();
Expand All @@ -33,7 +33,7 @@ public function testHttpClient()
$this->assertInstanceOf(HttpClient::class, $client);
}

public function testHttpClientNoDebug()
public function testHttpClientNoDebug(): void
{
static::bootKernel(['debug' => false]);
$container = static::$kernel->getContainer();
Expand All @@ -42,7 +42,7 @@ public function testHttpClientNoDebug()
$this->assertInstanceOf(HttpClient::class, $client);
}

public function testDebugToolbar()
public function testDebugToolbar(): void
{
static::bootKernel(['debug' => true]);
$container = static::$kernel->getContainer();
Expand All @@ -54,15 +54,15 @@ public function testDebugToolbar()
$this->assertInstanceOf(Collector::class, $collector);
}

public function testProfilingShouldNotChangeServiceReference()
public function testProfilingShouldNotChangeServiceReference(): void
{
static::bootKernel(['debug' => true]);
$container = static::$kernel->getContainer();

$this->assertInstanceof(RedirectPlugin::class, $container->get('app.http.plugin.custom'));
}

public function testProfilingDecoration()
public function testProfilingDecoration(): void
{
static::bootKernel(['debug' => true]);
$container = static::$kernel->getContainer();
Expand All @@ -81,7 +81,7 @@ public function testProfilingDecoration()
$this->assertInstanceOf(ProfilePlugin::class, $plugins[4]);
}

public function testProfilingPsr18Decoration()
public function testProfilingPsr18Decoration(): void
{
if (!interface_exists(ClientInterface::class)) {
$this->markTestSkipped('PSR-18 is not installed');
Expand Down
8 changes: 4 additions & 4 deletions tests/Resources/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function registerBundles()
/**
* {@inheritdoc}
*/
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
if ($this->isDebug()) {
Expand All @@ -49,7 +49,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
/**
* {@inheritdoc}
*/
protected function configureRoutes(RouteCollectionBuilder $routes)
protected function configureRoutes(RouteCollectionBuilder $routes): void
{
$routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt');
$routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler');
Expand Down Expand Up @@ -94,15 +94,15 @@ public function indexAction()
return new Response();
}

protected function build(ContainerBuilder $container)
protected function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new PublicServicesForFunctionalTestsPass());
}
}

class PublicServicesForFunctionalTestsPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$services = [
'httplug.strategy',
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ClientFactory/BuzzFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class BuzzFactoryTest extends TestCase
{
public function testCreateClient()
public function testCreateClient(): void
{
if (!class_exists(Client::class)) {
$this->markTestSkipped('Buzz adapter is not installed');
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ClientFactory/CurlFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
class CurlFactoryTest extends TestCase
{
public function testCreateClient()
public function testCreateClient(): void
{
if (!class_exists(Client::class)) {
$this->markTestSkipped('Curl client is not installed');
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ClientFactory/Guzzle6FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class Guzzle6FactoryTest extends TestCase
{
public function testCreateClient()
public function testCreateClient(): void
{
if (!class_exists(Client::class)) {
$this->markTestSkipped('Guzzle6 adapter is not installed');
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ClientFactory/MockFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
class MockFactoryTest extends TestCase
{
public function testCreateClient()
public function testCreateClient(): void
{
$factory = new MockFactory();
$client = $factory->createClient();
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ClientFactory/ReactFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class ReactFactoryTest extends TestCase
{
public function testCreateClient()
public function testCreateClient(): void
{
if (!class_exists(Client::class)) {
$this->markTestSkipped('React adapter is not installed');
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ClientFactory/SocketFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class SocketFactoryTest extends TestCase
{
public function testCreateClient()
public function testCreateClient(): void
{
if (!class_exists(Client::class)) {
$this->markTestSkipped('Socket client is not installed');
Expand Down
12 changes: 6 additions & 6 deletions tests/Unit/Collector/CollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class CollectorTest extends TestCase
{
public function testCollectClientNames()
public function testCollectClientNames(): void
{
$collector = new Collector();

Expand All @@ -19,7 +19,7 @@ public function testCollectClientNames()
$this->assertEquals(['default', 'acme'], $collector->getClients());
}

public function testActivateStack()
public function testActivateStack(): void
{
$parent = new Stack('acme', 'GET / HTTP/1.1');
$stack = new Stack('acme', 'GET / HTTP/1.1');
Expand All @@ -33,7 +33,7 @@ public function testActivateStack()
$this->assertEquals($stack, $collector->getActiveStack());
}

public function testDeactivateStack()
public function testDeactivateStack(): void
{
$stack = new Stack('acme', 'GET / HTTP/1.1');
$collector = new Collector();
Expand All @@ -45,7 +45,7 @@ public function testDeactivateStack()
$this->assertNull($collector->getActiveStack());
}

public function testDeactivateStackSetParentAsActiveStack()
public function testDeactivateStackSetParentAsActiveStack(): void
{
$parent = new Stack('acme', 'GET / HTTP/1.1');
$stack = new Stack('acme', 'GET / HTTP/1.1');
Expand All @@ -59,7 +59,7 @@ public function testDeactivateStackSetParentAsActiveStack()
$this->assertEquals($parent, $collector->getActiveStack());
}

public function testAddStack()
public function testAddStack(): void
{
$stack = new Stack('acme', 'GET / HTTP/1.1');
$collector = new Collector();
Expand All @@ -70,7 +70,7 @@ public function testAddStack()
$this->assertEquals([$stack], $collector->getClientRootStacks('acme'));
}

public function testResetAction()
public function testResetAction(): void
{
$stack = new Stack('acme', 'GET / HTTP/1.1');

Expand Down
Loading