Skip to content

Commit

Permalink
accept new defaults from php-cs
Browse files Browse the repository at this point in the history
  • Loading branch information
hugochinchilla committed Jan 22, 2021
1 parent ceee5a0 commit 35364cd
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 38 deletions.
8 changes: 4 additions & 4 deletions tests/BaldinofRoadRunnerBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class BaldinofRoadRunnerBundleTest extends TestCase
{
public function test_it_loads_sentry_middleware_if_needed()
public function testItLoadsSentryMiddlewareIfNeeded()
{
$k = $this->getKernel([], [
new SentryBundle(),
Expand All @@ -30,7 +30,7 @@ public function test_it_loads_sentry_middleware_if_needed()
$this->assertTrue($c->has(SentryMiddleware::class));
}

public function test_it_loads_sentry_middleware_if_not_needed()
public function testItLoadsSentryMiddlewareIfNotNeeded()
{
$k = $this->getKernel([], []);
$k->boot();
Expand All @@ -40,7 +40,7 @@ public function test_it_loads_sentry_middleware_if_not_needed()
$this->assertFalse($c->has(SentryMiddleware::class));
}

public function test_it_does_not_load_default_integrations_according_to_config()
public function testItDoesNotLoadDefaultIntegrationsAccordingToConfig()
{
$k = $this->getKernel(['default_integrations' => false], [
new SentryBundle(),
Expand All @@ -53,7 +53,7 @@ public function test_it_does_not_load_default_integrations_according_to_config()
$this->assertFalse($c->has(SentryMiddleware::class));
}

public function test_it_decorates_StreamedResponseListener()
public function testItDecoratesStreamedResponseListener()
{
$k = $this->getKernel([], []);

Expand Down
2 changes: 1 addition & 1 deletion tests/EventListener/ConfigureVarDumperListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConfigureVarDumperListenerTest extends TestCase
{
public static $dumped;

public function test_it_replaces_VarDumper_handler()
public function testItReplacesVarDumperHandler()
{
$dumperCloner = new class() implements DataDumperInterface {
public function dump(Data $data)
Expand Down
4 changes: 2 additions & 2 deletions tests/EventListener/StreamedResponseListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class StreamedResponseListenerTest extends TestCase
* @testWith [ true, false ]
* [ false, true ]
*/
public function test_it_calls_the_decorated_listener_if_needed(bool $rrEnabled, bool $responseShouldBeSent): void
public function testItCallsTheDecoratedListenerIfNeeded(bool $rrEnabled, bool $responseShouldBeSent): void
{
$listener = new StreamedResponseListener(new SymfonyStreamedResponseListener(), $rrEnabled);

Expand All @@ -33,7 +33,7 @@ public function test_it_calls_the_decorated_listener_if_needed(bool $rrEnabled,
$this->assertEquals($responseShouldBeSent, $responseSent);
}

public function test_it_registers_listener_with_the_same_priority()
public function testItRegistersListenerWithTheSamePriority()
{
$providedEvents = StreamedResponseListener::getSubscribedEvents();
$symfonyProvidedEvents = SymfonyStreamedResponseListener::getSubscribedEvents();
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/KernelHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class KernelHandlerTest extends TestCase
{
public function test_it_calls_the_kernel()
public function testItCallsTheKernel()
{
$kernel = $this->kernel(function (Request $request) {
$this->assertSame('http://example.org/', $request->getUri());
Expand All @@ -43,7 +43,7 @@ public function test_it_calls_the_kernel()
/**
* @dataProvider provideBasicAuthTest
*/
public function test_it_handles_basic_auth_header(array $headers, $expectedUser, $expectedPassword)
public function testItHandlesBasicAuthHeader(array $headers, $expectedUser, $expectedPassword)
{
/** @var Request|null $collectedRequest */
$collectedRequest = null;
Expand Down
10 changes: 5 additions & 5 deletions tests/Http/Middleware/DoctrineMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
);
}

public function test_skip_not_initialized_connections()
public function testSkipNotInitializedConnections()
{
$this->container->set(self::CONNECTION_NAME, null);

Expand All @@ -77,7 +77,7 @@ public function test_skip_not_initialized_connections()
consumes($this->middleware->process($this->request, $this->handler));
}

public function test_skip_when_not_connected(): void
public function testSkipWhenNotConnected(): void
{
$this->connectionMock->method('isConnected')->willReturn(false);
$this->connectionMock->expects($this->never())->method('ping');
Expand All @@ -87,7 +87,7 @@ public function test_skip_when_not_connected(): void
consumes($this->middleware->process($this->request, $this->handler));
}

public function test_it_closes_not_pingable_connection(): void
public function testItClosesNotPingableConnection(): void
{
$this->connectionMock->expects($this->once())->method('ping')->willReturn(false);
$this->connectionMock->method('isConnected')->willReturn(true);
Expand All @@ -97,7 +97,7 @@ public function test_it_closes_not_pingable_connection(): void
consumes($this->middleware->process($this->request, $this->handler));
}

public function test_it_force_reboot_on_closed_manager_when_missing_proxy_support()
public function testItForceRebootOnClosedManagerWhenMissingProxySupport()
{
$rebootForced = false;

Expand All @@ -115,7 +115,7 @@ public function test_it_force_reboot_on_closed_manager_when_missing_proxy_suppor
$this->assertTrue($rebootForced, 'A ForceKernelRebootEvent should have been dispatched');
}

public function test_it_skip_lazy_entity_managers()
public function testItSkipLazyEntityManagers()
{
$rebootForced = false;

Expand Down
8 changes: 4 additions & 4 deletions tests/Http/Middleware/NativeSessionMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setUp(): void
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_sessions_works()
public function testSessionsWorks()
{
$response = $this->process($this->emptyRequest());

Expand All @@ -50,7 +50,7 @@ public function test_sessions_works()
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_it_uses_php_params()
public function testItUsesPhpParams()
{
$lifetime = 600;
$now = time();
Expand Down Expand Up @@ -79,7 +79,7 @@ public function test_it_uses_php_params()
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_it_closes_session_if_the_handler_throws()
public function testItClosesSessionIfTheHandlerThrows()
{
$expectedException = new \Exception('Error during handler');
try {
Expand All @@ -97,7 +97,7 @@ public function test_it_closes_session_if_the_handler_throws()
}
}

public function test_it_throws_if_headers_already_sent()
public function testItThrowsIfHeadersAlreadySent()
{
if (!headers_sent()) {
$this->markAsRisky();
Expand Down
6 changes: 3 additions & 3 deletions tests/Http/MiddlewareStackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setUp(): void
self::$out = '';
}

public function test_it_calls_middlewares_in_expected_order()
public function testItCallsMiddlewaresInExpectedOrder()
{
$stack = new MiddlewareStack(new class() implements IteratorRequestHandlerInterface {
public function handle(ServerRequestInterface $request): \Iterator
Expand Down Expand Up @@ -68,7 +68,7 @@ public function handle(ServerRequestInterface $request): \Iterator
TXT, $this->getOut());
}

public function test_it_works_with_psr_handler()
public function testItWorksWithPsrHandler()
{
$handler = $this->prophesize(RequestHandlerInterface::class);
$handler->handle(Argument::any())->willReturn($response = new Response());
Expand All @@ -79,7 +79,7 @@ public function test_it_works_with_psr_handler()
$this->assertSame($response, $gen->current());
}

public function test_a_middleware_can_modify_the_response()
public function testAMiddlewareCanModifyTheResponse()
{
$handler = $this->prophesize(RequestHandlerInterface::class);
$handler->handle(Argument::any())->willReturn($response = new Response());
Expand Down
10 changes: 5 additions & 5 deletions tests/Metric/MetricFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@

class MetricFactoryTest extends TestCase
{
public function test_is_metrics_enabled_but_run_without_rr(): void
public function testIsMetricsEnabledButRunWithoutRr(): void
{
$metricFactory = new MetricFactory(null, false, '', true);
$this->assertInstanceOf(NullMetrics::class, $metricFactory->getMetricService());
}

public function test_is_metrics_enabled_but_rpc_not_configured(): void
public function testIsMetricsEnabledButRpcNotConfigured(): void
{
$metricFactory = new MetricFactory(null, true, '', true);
$this->expectException(BadConfigurationException::class);
$metricFactory->getMetricService();
}

public function test_is_null_metrics_created_when_metrics_disabled()
public function testIsNullMetricsCreatedWhenMetricsDisabled()
{
$metricFactory = new MetricFactory(null, true, '', false);
$this->assertInstanceOf(NullMetrics::class, $metricFactory->getMetricService());
Expand All @@ -35,7 +35,7 @@ public function test_is_null_metrics_created_when_metrics_disabled()
/**
* @dataProvider correctDsnProvider
*/
public function test_correct_dsn(string $dsn)
public function testCorrectDsn(string $dsn)
{
$metricFactory = new MetricFactory($dsn, true, '', true);
$this->assertInstanceOf(MetricsInterface::class, $metricFactory->getMetricService());
Expand All @@ -55,7 +55,7 @@ public function correctDsnProvider($dsn)
/**
* @dataProvider wrongDsnProvider
*/
public function test_wrong_rpc_dsn(string $dsn)
public function testWrongRpcDsn(string $dsn)
{
$metricFactory = new MetricFactory($dsn, true, '', true);
$this->expectException(UnknownRpcTransportException::class);
Expand Down
12 changes: 6 additions & 6 deletions tests/Reboot/OnExceptionRebootStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,33 @@ public function setUp(): void
$this->dispatcher->addSubscriber($this->strategy);
}

public function test_it_does_not_reboot_by_default()
public function testItDoesNotRebootByDefault()
{
$this->assertFalse($this->strategy->shouldReboot());
}

public function test_it_reboot_on_unexpected_exception()
public function testItRebootOnUnexpectedException()
{
$this->dispatchException(new \RuntimeException());

$this->assertTrue($this->strategy->shouldReboot());
}

public function test_it_does_not_reboot_on_allowed_exception()
public function testItDoesNotRebootOnAllowedException()
{
$this->dispatchException(new AllowedException());

$this->assertFalse($this->strategy->shouldReboot());
}

public function test_it_does_not_reboot_on_allowed_exception_child()
public function testItDoesNotRebootOnAllowedExceptionChild()
{
$this->dispatchException(new ChildAllowedException());

$this->assertFalse($this->strategy->shouldReboot());
}

public function test_clear_reset_the_state()
public function testClearResetTheState()
{
$this->dispatchException(new \RuntimeException());
$this->strategy->clear();
Expand All @@ -70,7 +70,7 @@ public function test_clear_reset_the_state()
$this->assertFalse($this->strategy->shouldReboot());
}

public function test_it_can_be_notified_to_force_reboot()
public function testItCanBeNotifiedToForceReboot()
{
$this->dispatcher->dispatch(new ForceKernelRebootEvent('something bad happened'));

Expand Down
12 changes: 6 additions & 6 deletions tests/Worker/WorkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function clear(): void
);
}

public function test_it_setup_trusted_proxies_and_hosts()
public function testItSetupTrustedProxiesAndHosts()
{
$_ENV['TRUSTED_PROXIES'] = '10.0.0.1,10.0.0.2';
$_ENV['TRUSTED_HOSTS'] = 'example.org,example.com';
Expand All @@ -128,7 +128,7 @@ public function test_it_setup_trusted_proxies_and_hosts()
* @testWith [ "Baldinof\\RoadRunnerBundle\\Event\\WorkerStartEvent" ]
* [ "Baldinof\\RoadRunnerBundle\\Event\\WorkerStopEvent" ]
*/
public function test_it_dispatches_events($eventName)
public function testItDispatchesEvents($eventName)
{
$called = false;
$this->eventDispatcher->addListener($eventName, function () use (&$called) {
Expand All @@ -140,7 +140,7 @@ public function test_it_dispatches_events($eventName)
$this->assertTrue($called);
}

public function test_it_calls_the_handler()
public function testItCallsTheHandler()
{
// Force re-throw caught exception.
$this->eventDispatcher->addListener(WorkerExceptionEvent::class, function (WorkerExceptionEvent $e) {
Expand Down Expand Up @@ -174,7 +174,7 @@ public function test_it_calls_the_handler()
$this->assertTrue($psrClientCalled, 'PSR Client seems to not have been called.');
}

public function test_an_error_stops_the_worker()
public function testAnErrorStopsTheWorker()
{
$this->requests->push(new ServerRequest('GET', 'http://example.org/'));
$this->requests->push(new ServerRequest('GET', 'http://example.org/'));
Expand All @@ -196,7 +196,7 @@ public function test_an_error_stops_the_worker()
$this->assertTrue($called, WorkerStopEvent::class.' has not been dispatched');
}

public function test_an_error_in_debug_mode_shows_the_trace_and_stops_the_worker()
public function testAnErrorInDebugModeShowsTheTraceAndStopsTheWorker()
{
$this->requests->push(new ServerRequest('GET', 'http://example.org/'));
$this->requests->push(new ServerRequest('GET', 'http://example.org/'));
Expand Down Expand Up @@ -225,7 +225,7 @@ public function test_an_error_in_debug_mode_shows_the_trace_and_stops_the_worker
$this->assertTrue($called, WorkerStopEvent::class.' has not been dispatched');
}

public function test_it_reboot_the_kernel_according_to_the_strategy()
public function testItRebootTheKernelAccordingToTheStrategy()
{
$this->responder = function () use (&$terminated) {
yield new Response(200, [], 'hello');
Expand Down

0 comments on commit 35364cd

Please sign in to comment.