Skip to content

Commit

Permalink
fix: code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Jan 16, 2024
1 parent d7c8ffd commit f11d288
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/DataBagTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Atoolo\Resource\Test;

use Atoolo\Resource\DataBag;
Expand Down Expand Up @@ -62,6 +64,18 @@ public function testGetStringWithDefault(): void
);
}

public function testGetDifferentType(): void
{
$resource = new DataBag(
['field' => '123']
);
$this->assertEquals(
0,
$resource->getInt('field'),
'expected value to be fallback of zero'
);
}

public function testGetInt(): void
{
$resource = new DataBag(
Expand Down
2 changes: 2 additions & 0 deletions test/resources/Loader/SiteKitResourceHierarchyLoader/a.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/a.php',
'a',
Expand Down
2 changes: 2 additions & 0 deletions test/resources/Loader/SiteKitResourceHierarchyLoader/b.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/b.php',
'b',
Expand Down
2 changes: 2 additions & 0 deletions test/resources/Loader/SiteKitResourceHierarchyLoader/c.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/c.php',
'c',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/primaryParentWithoutUrl.php',
'primaryParentWithoutUrl',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/primaryParentWithoutUrl.php',
'primaryParentWithoutUrl',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/primaryParentWithoutUrl.php',
'primaryParentWithoutUrl',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/primaryParentWithoutUrl.php',
'primaryParentWithoutUrl',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/primaryParentWithoutUrl.php',
'primaryParentWithoutUrl',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return new \Atoolo\Resource\Resource(
'/primaryParentWithoutUrl.php',
'primaryParentWithoutUrl',
Expand Down

0 comments on commit f11d288

Please sign in to comment.