-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add singel administration unit case
- Loading branch information
Daniel Kurowski
committed
Nov 28, 2023
1 parent
cf10f8d
commit fdf3072
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
use HnutiBrontosaurus\BisClient\BisClient; | ||
use HnutiBrontosaurus\BisClient\NotFound; | ||
|
||
|
||
/** @var BisClient $client */ | ||
$client = require_once __DIR__ . '/bootstrap.php'; | ||
?> | ||
|
||
<h2>Administration unit</h2> | ||
<form method="get"> | ||
ID: <input type="text" name="id" value="<?php echo $_GET['id'] ?>"> | ||
<input type="submit" value="Go"> | ||
</form> | ||
|
||
<?php | ||
|
||
if (empty($_GET['id'])) { | ||
exit; | ||
} | ||
|
||
$id = (int) $_GET['id']; | ||
$units = $client->getAdministrationUnits(); | ||
foreach ($units as $unit) { | ||
if ($unit->getId() === $id) { | ||
dump($unit); | ||
exit; | ||
} | ||
} | ||
|
||
echo 'not found'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters