Skip to content

Commit a059806

Browse files
committed
refactor: change notation type in methods
The notation type in the test function names has been changed from camel to snake case for readability. Closes #1
1 parent a36a6c9 commit a059806

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

tests/ExceptionHandlerTest.php

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?php
22

33
/*
4-
* This file is part of https://github.com/josantonius/php-exception-handler repository.
5-
*
6-
* (c) Josantonius <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
4+
* This file is part of https://github.com/josantonius/php-exception-handler repository.
5+
*
6+
* (c) Josantonius <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
12+
*/
1113

1214
namespace Josantonius\ErrorHandler\Tests;
1315

@@ -31,14 +33,14 @@ public function setUp(): void
3133
$this->handler = new Handler();
3234
}
3335

34-
public function testShouldFailIfCallableCallbackIsNotPassed(): void
36+
public function test_should_fail_if_callable_callback_is_not_passed(): void
3537
{
3638
$this->expectException(NotCallableException::class);
3739

3840
new ExceptionHandler(callback: 'foo');
3941
}
4042

41-
public function testShouldFailIfTheMethodNamesNotContainValidDataType(): void
43+
public function test_should_fail_if_the_method_names_not_contain_valid_data_type(): void
4244
{
4345
$this->expectException(WrongMethodNameException::class);
4446

@@ -48,15 +50,15 @@ public function testShouldFailIfTheMethodNamesNotContainValidDataType(): void
4850
);
4951
}
5052

51-
public function testShouldSetTheHandlerOnlyWithTheCallback(): void
53+
public function test_should_set_the_handler_only_with_the_callback(): void
5254
{
5355
$this->assertInstanceOf(
5456
ExceptionHandler::class,
5557
new ExceptionHandler(callback: $this->handler->init(...))
5658
);
5759
}
5860

59-
public function testShouldSetTheHandlerOnlyWithCallsToRunBefore(): void
61+
public function test_should_set_the_handler_only_with_calls_to_run_before(): void
6062
{
6163
$this->assertInstanceOf(
6264
ExceptionHandler::class,
@@ -67,7 +69,7 @@ public function testShouldSetTheHandlerOnlyWithCallsToRunBefore(): void
6769
);
6870
}
6971

70-
public function testShouldSetTheHandlerOnlyWithCallsToAfter(): void
72+
public function test_should_set_the_handler_only_with_calls_to_after(): void
7173
{
7274
$this->assertInstanceOf(
7375
ExceptionHandler::class,
@@ -78,7 +80,7 @@ public function testShouldSetTheHandlerOnlyWithCallsToAfter(): void
7880
);
7981
}
8082

81-
public function testShouldCallTheCallbackWhenAnExceptionIsThrow(): void
83+
public function test_should_call_the_callback_when_an_exception_is_throw(): void
8284
{
8385
$exceptionHandler = new ExceptionHandler(callback: $this->handler->init(...));
8486

@@ -94,7 +96,7 @@ public function testShouldCallTheCallbackWhenAnExceptionIsThrow(): void
9496
$this->assertEquals('init', History::get(0)->methodName);
9597
}
9698

97-
public function testShouldCallTheCallbackBeforeRunMethodsWhenAnExceptionIsThrow(): void
99+
public function test_should_call_the_callback_before_run_methods_when_exception_is_throw(): void
98100
{
99101
$exceptionHandler = new ExceptionHandler(
100102
callback: $this->handler->init(...),
@@ -113,7 +115,7 @@ public function testShouldCallTheCallbackBeforeRunMethodsWhenAnExceptionIsThrow(
113115
$this->assertEquals('context', History::get(0)->methodName);
114116
}
115117

116-
public function testShouldCallTheCallbackAfterRunMethodsWhenAnExceptionIsThrow(): void
118+
public function test_should_call_the_callback_after_run_methods_when_exception_is_throw(): void
117119
{
118120
$exceptionHandler = new ExceptionHandler(
119121
callback: $this->handler->init(...),
@@ -134,7 +136,7 @@ public function testShouldCallTheCallbackAfterRunMethodsWhenAnExceptionIsThrow()
134136
$this->assertEquals('render', History::get(2)->methodName);
135137
}
136138

137-
public function testShouldCallTheCallbackAfterAndBeforeRunMethodsWhenAnExceptionIsThrow(): void
139+
public function test_should_call_callback_and_all_methods_when_an_exception_is_throw(): void
138140
{
139141
$exceptionHandler = new ExceptionHandler(
140142
callback: $this->handler->init(...),

0 commit comments

Comments
 (0)