Skip to content

Commit f34317b

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 #20
1 parent 05c8cf2 commit f34317b

16 files changed

+95
-63
lines changed

tests/AllMethodTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -29,7 +31,7 @@ public function setUp(): void
2931
/**
3032
* @runInSeparateProcess
3133
*/
32-
public function testShouldGetAllAttributes(): void
34+
public function test_should_get_all_attributes(): void
3335
{
3436
$this->session->start();
3537

@@ -41,7 +43,7 @@ public function testShouldGetAllAttributes(): void
4143
/**
4244
* @runInSeparateProcess
4345
*/
44-
public function testShouldGetAllAttributesDefinedOutsideLibrary(): void
46+
public function test_should_get_all_attributes_defined_outside_library(): void
4547
{
4648
session_start();
4749

@@ -53,15 +55,15 @@ public function testShouldGetAllAttributesDefinedOutsideLibrary(): void
5355
/**
5456
* @runInSeparateProcess
5557
*/
56-
public function testShouldReturnEmptyArrayWhenUnstartedSession(): void
58+
public function test_should_return_empty_array_when_unstarted_session(): void
5759
{
5860
$this->assertIsArray($this->session->all());
5961
}
6062

6163
/**
6264
* @runInSeparateProcess
6365
*/
64-
public function testShouldBeAvailableFromTheFacade(): void
66+
public function test_should_be_available_from_the_facade(): void
6567
{
6668
$facade = new SessionFacade();
6769

tests/ClearMethodTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -30,7 +32,7 @@ public function setUp(): void
3032
/**
3133
* @runInSeparateProcess
3234
*/
33-
public function testShouldClearSession(): void
35+
public function test_should_clear_session(): void
3436
{
3537
$this->session->start();
3638

@@ -44,7 +46,7 @@ public function testShouldClearSession(): void
4446
/**
4547
* @runInSeparateProcess
4648
*/
47-
public function testShouldClearSessionWhenNativeSessionWasStarted(): void
49+
public function test_should_clear_session_when_native_session_was_started(): void
4850
{
4951
session_start();
5052

@@ -58,7 +60,7 @@ public function testShouldClearSessionWhenNativeSessionWasStarted(): void
5860
/**
5961
* @runInSeparateProcess
6062
*/
61-
public function testShouldFailIfSessionIsUnstarted(): void
63+
public function test_should_fail_if_session_is_unstarted(): void
6264
{
6365
$this->expectException(SessionNotStartedException::class);
6466

@@ -68,7 +70,7 @@ public function testShouldFailIfSessionIsUnstarted(): void
6870
/**
6971
* @runInSeparateProcess
7072
*/
71-
public function testShouldBeAvailableFromTheFacade(): void
73+
public function test_should_be_available_from_the_facade(): void
7274
{
7375
$facade = new SessionFacade();
7476

tests/DestroyMethodTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -30,7 +32,7 @@ public function setUp(): void
3032
/**
3133
* @runInSeparateProcess
3234
*/
33-
public function testShouldDestroySession(): void
35+
public function test_should_destroy_session(): void
3436
{
3537
$this->session->start();
3638

@@ -44,7 +46,7 @@ public function testShouldDestroySession(): void
4446
/**
4547
* @runInSeparateProcess
4648
*/
47-
public function testShouldDestroySessionWhenNativeSessionWasStarted(): void
49+
public function test_should_destroy_session_when_native_session_was_started(): void
4850
{
4951
session_start();
5052

@@ -58,7 +60,7 @@ public function testShouldDestroySessionWhenNativeSessionWasStarted(): void
5860
/**
5961
* @runInSeparateProcess
6062
*/
61-
public function testShouldFailIfSessionIsUnstarted(): void
63+
public function test_should_fail_if_session_is_unstarted(): void
6264
{
6365
$this->expectException(SessionNotStartedException::class);
6466

@@ -68,7 +70,7 @@ public function testShouldFailIfSessionIsUnstarted(): void
6870
/**
6971
* @runInSeparateProcess
7072
*/
71-
public function testShouldBeAvailableFromTheFacade(): void
73+
public function test_should_be_available_from_the_facade(): void
7274
{
7375
$facade = new SessionFacade();
7476

tests/GetIdMethodTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -29,7 +31,7 @@ public function setUp(): void
2931
/**
3032
* @runInSeparateProcess
3133
*/
32-
public function testShouldGetSessionId(): void
34+
public function test_should_get_session_id(): void
3335
{
3436
$this->session->start();
3537

@@ -39,7 +41,7 @@ public function testShouldGetSessionId(): void
3941
/**
4042
* @runInSeparateProcess
4143
*/
42-
public function testShouldGetSessionIdIfNativeSessionWasStarted(): void
44+
public function test_should_get_session_id_if_native_session_was_started(): void
4345
{
4446
session_start();
4547

@@ -49,15 +51,15 @@ public function testShouldGetSessionIdIfNativeSessionWasStarted(): void
4951
/**
5052
* @runInSeparateProcess
5153
*/
52-
public function testShouldReturnEmptyStringIfSessionIsUnstarted(): void
54+
public function test_should_return_empty_string_if_session_is_unstarted(): void
5355
{
5456
$this->assertEquals('', $this->session->getId());
5557
}
5658

5759
/**
5860
* @runInSeparateProcess
5961
*/
60-
public function testShouldBeAvailableFromTheFacade(): void
62+
public function test_should_be_available_from_the_facade(): void
6163
{
6264
$facade = new SessionFacade();
6365

tests/GetMethodTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -29,7 +31,7 @@ public function setUp(): void
2931
/**
3032
* @runInSeparateProcess
3133
*/
32-
public function testShouldGetAttributeIfExists(): void
34+
public function test_should_get_attribute_if_exists(): void
3335
{
3436
$this->session->start();
3537

@@ -41,7 +43,7 @@ public function testShouldGetAttributeIfExists(): void
4143
/**
4244
* @runInSeparateProcess
4345
*/
44-
public function testShouldGetDefaultValueIfNotExists(): void
46+
public function test_should_get_default_value_if_not_exists(): void
4547
{
4648
$this->session->start();
4749

@@ -51,7 +53,7 @@ public function testShouldGetDefaultValueIfNotExists(): void
5153
/**
5254
* @runInSeparateProcess
5355
*/
54-
public function testShouldGetCustomDefaultValueIfNotExists(): void
56+
public function test_should_get_custom_default_value_if_not_exists(): void
5557
{
5658
$this->session->start();
5759

@@ -61,7 +63,7 @@ public function testShouldGetCustomDefaultValueIfNotExists(): void
6163
/**
6264
* @runInSeparateProcess
6365
*/
64-
public function testShouldGetAttributeDefinedOutsideLibrary(): void
66+
public function test_should_get_attribute_defined_outside_library(): void
6567
{
6668
session_start();
6769

@@ -73,7 +75,7 @@ public function testShouldGetAttributeDefinedOutsideLibrary(): void
7375
/**
7476
* @runInSeparateProcess
7577
*/
76-
public function testShouldBeAvailableFromTheFacade(): void
78+
public function test_should_be_available_from_the_facade(): void
7779
{
7880
$facade = new SessionFacade();
7981

tests/GetNameMethodTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -29,7 +31,7 @@ public function setUp(): void
2931
/**
3032
* @runInSeparateProcess
3133
*/
32-
public function testShouldGetSessionName(): void
34+
public function test_should_get_session_name(): void
3335
{
3436
$this->session->start();
3537

@@ -39,7 +41,7 @@ public function testShouldGetSessionName(): void
3941
/**
4042
* @runInSeparateProcess
4143
*/
42-
public function testShouldGetSessionNameIfNativeSessionWasStarted(): void
44+
public function test_should_get_session_name_if_native_session_was_started(): void
4345
{
4446
session_start();
4547

@@ -49,15 +51,15 @@ public function testShouldGetSessionNameIfNativeSessionWasStarted(): void
4951
/**
5052
* @runInSeparateProcess
5153
*/
52-
public function testShouldReturnEmptyStringIfSessionIsUnstarted(): void
54+
public function test_should_return_empty_string_if_session_is_unstarted(): void
5355
{
5456
$this->assertEquals('PHPSESSID', $this->session->getName());
5557
}
5658

5759
/**
5860
* @runInSeparateProcess
5961
*/
60-
public function testShouldBeAvailableFromTheFacade(): void
62+
public function test_should_be_available_from_the_facade(): void
6163
{
6264
$facade = new SessionFacade();
6365

tests/HasMethodTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -29,7 +31,7 @@ public function setUp(): void
2931
/**
3032
* @runInSeparateProcess
3133
*/
32-
public function testShouldCheckIfAttributeExists(): void
34+
public function test_should_check_if_attribute_exists(): void
3335
{
3436
$this->session->start();
3537

@@ -43,7 +45,7 @@ public function testShouldCheckIfAttributeExists(): void
4345
/**
4446
* @runInSeparateProcess
4547
*/
46-
public function testShouldCheckAttributeDefinedOutsideLibrary(): void
48+
public function test_should_check_attribute_defined_outside_library(): void
4749
{
4850
session_start();
4951

@@ -55,7 +57,7 @@ public function testShouldCheckAttributeDefinedOutsideLibrary(): void
5557
/**
5658
* @runInSeparateProcess
5759
*/
58-
public function testShouldBeAvailableFromTheFacade(): void
60+
public function test_should_be_available_from_the_facade(): void
5961
{
6062
$facade = new SessionFacade();
6163

tests/IsStartedMethodTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -29,7 +31,7 @@ public function setUp(): void
2931
/**
3032
* @runInSeparateProcess
3133
*/
32-
public function testShouldCheckIfSessionIsActive(): void
34+
public function test_should_check_if_session_is_active(): void
3335
{
3436
$this->assertFalse($this->session->isStarted());
3537

@@ -41,7 +43,7 @@ public function testShouldCheckIfSessionIsActive(): void
4143
/**
4244
* @runInSeparateProcess
4345
*/
44-
public function testShouldBeAvailableFromTheFacade(): void
46+
public function test_should_be_available_from_the_facade(): void
4547
{
4648
$facade = new SessionFacade();
4749

tests/PullMethodTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
10+
*
11+
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1012
*/
1113

1214
namespace Josantonius\Session\Tests;
@@ -30,7 +32,7 @@ public function setUp(): void
3032
/**
3133
* @runInSeparateProcess
3234
*/
33-
public function testShouldPullAttributeAndReturnTheValueIfExists(): void
35+
public function test_should_pull_attribute_and_return_the_value_if_exists(): void
3436
{
3537
$this->session->start();
3638

@@ -44,7 +46,7 @@ public function testShouldPullAttributeAndReturnTheValueIfExists(): void
4446
/**
4547
* @runInSeparateProcess
4648
*/
47-
public function testShouldReturnDefaultValueIfAttributeNotExists(): void
49+
public function test_should_return_default_value_if_attribute_not_exists(): void
4850
{
4951
$this->session->start();
5052

@@ -54,7 +56,7 @@ public function testShouldReturnDefaultValueIfAttributeNotExists(): void
5456
/**
5557
* @runInSeparateProcess
5658
*/
57-
public function testShouldReturnCustomDefaultValueIfAttributeNotExists(): void
59+
public function test_should_return_custom_default_value_if_attribute_not_exists(): void
5860
{
5961
$this->session->start();
6062

@@ -64,7 +66,7 @@ public function testShouldReturnCustomDefaultValueIfAttributeNotExists(): void
6466
/**
6567
* @runInSeparateProcess
6668
*/
67-
public function testShouldFailIfSessionIsUnstarted()
69+
public function test_should_fail_if_session_is_unstarted()
6870
{
6971
$this->expectException(SessionNotStartedException::class);
7072

@@ -74,7 +76,7 @@ public function testShouldFailIfSessionIsUnstarted()
7476
/**
7577
* @runInSeparateProcess
7678
*/
77-
public function testShouldBeAvailableFromTheFacade(): void
79+
public function test_should_be_available_from_the_facade(): void
7880
{
7981
$facade = new SessionFacade();
8082

0 commit comments

Comments
 (0)