File tree Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : " Code Quality 🏆"
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ build :
7
+ runs-on : ubuntu-latest
8
+
9
+ steps :
10
+ - uses : actions/checkout@v2
11
+ - name : Set up PHP
12
+ uses : shivammathur/setup-php@v2
13
+ with :
14
+ php-version : " 8.0"
15
+ - name : Install dependencies
16
+ run : composer install
17
+ - name : Run tests
18
+ run : composer test
Original file line number Diff line number Diff line change 1
1
.DS_Store
2
2
vendor
3
+ composer.lock
3
4
.phpunit.result.cache
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <phpunit bootstrap =" vendor/autoload.php" >
3
+ <testsuites >
4
+ <testsuite name =" Application Test Suite" >
5
+ <directory >tests</directory >
6
+ </testsuite >
7
+ </testsuites >
8
+ </phpunit >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use GaryDavisonOs \ConditionalHelpers \ConditionalHelpers ;
4
+ use PHPUnit \Framework \TestCase ;
5
+
6
+ class ConditionalHelpersTest extends TestCase
7
+ {
8
+ public function testIsArrayHasLength ()
9
+ {
10
+ $ array = [1 , 2 , 3 ];
11
+ $ this ->assertTrue (ConditionalHelpers::isArrayHasLength ($ array ));
12
+
13
+ $ emptyArray = [];
14
+ $ this ->assertFalse (ConditionalHelpers::isArrayHasLength ($ emptyArray ));
15
+ }
16
+
17
+ public function testIsStringHasLength ()
18
+ {
19
+ $ string = "Hello, World! " ;
20
+ $ this ->assertTrue (ConditionalHelpers::isStringHasLength ($ string ));
21
+
22
+ $ emptyString = "" ;
23
+ $ this ->assertFalse (ConditionalHelpers::isStringHasLength ($ emptyString ));
24
+ }
25
+
26
+ public function testIsBooleanTrue ()
27
+ {
28
+ $ this ->assertTrue (ConditionalHelpers::isBooleanTrue (true ));
29
+ $ this ->assertFalse (ConditionalHelpers::isBooleanTrue (false ));
30
+ }
31
+
32
+ public function testIsBooleanFalse ()
33
+ {
34
+ $ this ->assertTrue (ConditionalHelpers::isBooleanFalse (false ));
35
+ $ this ->assertFalse (ConditionalHelpers::isBooleanFalse (true ));
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments