-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8272f26
commit 91c06b8
Showing
23 changed files
with
3,573 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,43 @@ | ||
<?php | ||
|
||
namespace Square\Tests\Integration; | ||
|
||
use DateTime; | ||
use DateTimeInterface; | ||
use PHPUnit\Framework\TestCase; | ||
use Square\CashDrawers\Shifts\Requests\ListShiftsRequest; | ||
use Square\Exceptions\SquareApiException; | ||
use Square\Exceptions\SquareException; | ||
use Square\SquareClient; | ||
|
||
class CashDrawersTest extends TestCase | ||
{ | ||
private static SquareClient $client; | ||
|
||
public static function setUpBeforeClass(): void | ||
{ | ||
self::$client = Helpers::createClient(); | ||
} | ||
|
||
/** | ||
* @throws SquareException | ||
* @throws SquareApiException | ||
*/ | ||
public function testListCashDrawerShifts(): void | ||
{ | ||
$start = (new DateTime('-1 hour'))->format(DateTimeInterface::ATOM); | ||
$end = (new DateTime())->format(DateTimeInterface::ATOM); | ||
$locationId = Helpers::getDefaultLocationId(self::$client); | ||
|
||
$request = new ListShiftsRequest([ | ||
'locationId' => $locationId, | ||
'beginTime' => $start, | ||
'endTime' => $end, | ||
]); | ||
|
||
$response = self::$client->cashDrawers->shifts->list($request); | ||
|
||
$this->assertNotNull($response); | ||
iterator_to_array($response); | ||
} | ||
} |
Oops, something went wrong.