From b3e734b5212079aee5bf4cf8c05f949e4312e4a2 Mon Sep 17 00:00:00 2001 From: Levi Durfee Date: Sun, 10 Dec 2023 19:38:39 -0500 Subject: [PATCH] Add endpoints for Option contracts (#18) --- src/Rest/Options/Contract.php | 13 +++++++++++++ src/Rest/Options/Contracts.php | 13 +++++++++++++ tests/Rest/Options/ContractTest.php | 27 +++++++++++++++++++++++++++ tests/Rest/Options/ContractsTest.php | 27 +++++++++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 src/Rest/Options/Contract.php create mode 100644 src/Rest/Options/Contracts.php create mode 100644 tests/Rest/Options/ContractTest.php create mode 100644 tests/Rest/Options/ContractsTest.php diff --git a/src/Rest/Options/Contract.php b/src/Rest/Options/Contract.php new file mode 100644 index 0000000..8478f79 --- /dev/null +++ b/src/Rest/Options/Contract.php @@ -0,0 +1,13 @@ +_get('/v3/reference/options/contracts/' . $optionsTicker, $params); + } +} diff --git a/src/Rest/Options/Contracts.php b/src/Rest/Options/Contracts.php new file mode 100644 index 0000000..72828e0 --- /dev/null +++ b/src/Rest/Options/Contracts.php @@ -0,0 +1,13 @@ +_get('/v3/reference/options/contracts', $params); + } +} diff --git a/tests/Rest/Options/ContractTest.php b/tests/Rest/Options/ContractTest.php new file mode 100644 index 0000000..55d5d9c --- /dev/null +++ b/tests/Rest/Options/ContractTest.php @@ -0,0 +1,27 @@ +httpClient = $this->getHttpMock( + $requestsContainer, [ + 'results' => [], + ] + ); + + $contract->get('O:EVRI240119C00002500'); + + $this->assertPath($requestsContainer, '/v3/reference/options/contracts/O:EVRI240119C00002500'); + } +} diff --git a/tests/Rest/Options/ContractsTest.php b/tests/Rest/Options/ContractsTest.php new file mode 100644 index 0000000..d452bb1 --- /dev/null +++ b/tests/Rest/Options/ContractsTest.php @@ -0,0 +1,27 @@ +httpClient = $this->getHttpMock( + $requestsContainer, [ + 'results' => [], + ] + ); + + $contract->get(); + + $this->assertPath($requestsContainer, '/v3/reference/options/contracts'); + } +}