diff --git a/.gitignore b/.gitignore index 733dde7..63f63e9 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /debian/php-spojenet-ipex-b2b.substvars /debian/.debhelper/ /.build/ +/.phpunit.cache/ diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..f3a135d --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":2,"defects":{"Test\\IPEXB2B\\ApiClientTest::testSetUp":5,"Test\\IPEXB2B\\ApiClientTest::testCurlInit":5,"Test\\IPEXB2B\\ApiClientTest::testProcessInit":5,"Test\\IPEXB2B\\ApiClientTest::testSection":5,"Test\\IPEXB2B\\ApiClientTest::testSetPostFields":5,"Test\\IPEXB2B\\ApiClientTest::testGetSectionURL":5,"Test\\IPEXB2B\\ApiClientTest::testSetUrlParams":5,"Test\\IPEXB2B\\ApiClientTest::testUpdateApiURL":5,"Test\\IPEXB2B\\ApiClientTest::testRequestData":5,"Test\\IPEXB2B\\ApiClientTest::testRawResponseToArray":5,"Test\\IPEXB2B\\ApiClientTest::testParseResponse":5,"Test\\IPEXB2B\\ApiClientTest::testParseError":5,"Test\\IPEXB2B\\ApiClientTest::testDoCurlRequest":5,"Test\\IPEXB2B\\ApiClientTest::testLoadFromIPEX":5,"Test\\IPEXB2B\\ApiClientTest::testLogResult":5,"Test\\IPEXB2B\\ApiClientTest::testIpexDateTimeToDateTime":5,"Test\\IPEXB2B\\ApiClientTest::testGetTokenString":5,"Test\\IPEXB2B\\ApiClientTest::testIgnore404":5,"Test\\IPEXB2B\\ApiClientTest::testDisconnect":5,"Test\\IPEXB2B\\ApiClientTest::testWakeup":5,"Test\\IPEXB2B\\ApiClientTest::testDestruct":5,"Test\\IPEXB2B\\CallsTest::testSetUp":5,"Test\\IPEXB2B\\CallsTest::testCurlInit":5,"Test\\IPEXB2B\\CallsTest::testProcessInit":5,"Test\\IPEXB2B\\CallsTest::testSection":5,"Test\\IPEXB2B\\CallsTest::testSetPostFields":5,"Test\\IPEXB2B\\CallsTest::testGetSectionURL":5,"Test\\IPEXB2B\\CallsTest::testSetUrlParams":5,"Test\\IPEXB2B\\CallsTest::testUpdateApiURL":5,"Test\\IPEXB2B\\CallsTest::testRequestData":5,"Test\\IPEXB2B\\CallsTest::testRawResponseToArray":5,"Test\\IPEXB2B\\CallsTest::testParseResponse":5,"Test\\IPEXB2B\\CallsTest::testParseError":5,"Test\\IPEXB2B\\CallsTest::testDoCurlRequest":5,"Test\\IPEXB2B\\CallsTest::testLoadFromIPEX":5,"Test\\IPEXB2B\\CallsTest::testLogResult":5,"Test\\IPEXB2B\\CallsTest::testIpexDateTimeToDateTime":5,"Test\\IPEXB2B\\CallsTest::testGetTokenString":5,"Test\\IPEXB2B\\CallsTest::testIgnore404":5,"Test\\IPEXB2B\\CallsTest::testDisconnect":5,"Test\\IPEXB2B\\CallsTest::testWakeup":5,"Test\\IPEXB2B\\CallsTest::testDestruct":5,"Test\\IPEXB2B\\CallsTest::testGetCallsForNumber":5,"Test\\IPEXB2B\\CallsTest::testLoadCallsForCustomer":5,"Test\\IPEXB2B\\AccountsTest::testGetSection":5,"Test\\IPEXB2B\\AccountsTest::testGetSectionURL":5,"Test\\IPEXB2B\\AliveTest::testGetSection":5,"Test\\IPEXB2B\\AliveTest::testGetSectionURL":5,"Test\\IPEXB2B\\AnalysisTest::testGetSection":5,"Test\\IPEXB2B\\AnalysisTest::testGetSectionURL":5,"Test\\IPEXB2B\\ConnectorsTest::testGetSection":5,"Test\\IPEXB2B\\ConnectorsTest::testGetSectionURL":5,"Test\\IPEXB2B\\ContainersTest::testGetSection":5,"Test\\IPEXB2B\\ContainersTest::testGetSectionURL":5,"Test\\IPEXB2B\\CustomersTest::testGetSection":5,"Test\\IPEXB2B\\CustomersTest::testGetSectionURL":5,"Test\\IPEXB2B\\FreeUnitsTest::testGetSection":5,"Test\\IPEXB2B\\FreeUnitsTest::testGetSectionURL":5,"Test\\IPEXB2B\\HealthTest::testGetSection":5,"Test\\IPEXB2B\\HealthTest::testGetSectionURL":5,"Test\\IPEXB2B\\HelpdeskTest::testGetSection":5,"Test\\IPEXB2B\\HelpdeskTest::testGetSectionURL":5,"Test\\IPEXB2B\\IctPriceListTest::testGetSection":5,"Test\\IPEXB2B\\IctPriceListTest::testGetSectionURL":5,"Test\\IPEXB2B\\InternetTest::testGetSection":5,"Test\\IPEXB2B\\InternetTest::testGetSectionURL":5,"Test\\IPEXB2B\\InvoiceItemTest::testGetSection":5,"Test\\IPEXB2B\\InvoiceItemTest::testGetSectionURL":5,"Test\\IPEXB2B\\InvoicesTest::testGetSection":5,"Test\\IPEXB2B\\InvoicesTest::testGetSectionURL":5,"Test\\IPEXB2B\\MaintenanceTest::testGetSection":5,"Test\\IPEXB2B\\MaintenanceTest::testGetSectionURL":5,"Test\\IPEXB2B\\MobileTest::testGetSection":5,"Test\\IPEXB2B\\MobileTest::testGetSectionURL":5,"Test\\IPEXB2B\\NumbersTest::testGetSection":5,"Test\\IPEXB2B\\NumbersTest::testGetSectionURL":5,"Test\\IPEXB2B\\PbxTest::testGetSection":5,"Test\\IPEXB2B\\PbxTest::testGetSectionURL":5,"Test\\IPEXB2B\\PhoneNumbersTest::testGetSection":5,"Test\\IPEXB2B\\PhoneNumbersTest::testGetSectionURL":5,"Test\\IPEXB2B\\PhoneNumbersV2Test::testGetSection":5,"Test\\IPEXB2B\\PhoneNumbersV2Test::testGetSectionURL":5,"Test\\IPEXB2B\\ProvidersTest::testGetSection":5,"Test\\IPEXB2B\\ProvidersTest::testGetSectionURL":5,"Test\\IPEXB2B\\ReportsTest::testGetSection":5,"Test\\IPEXB2B\\ReportsTest::testGetSectionURL":5,"Test\\IPEXB2B\\RequestsTest::testGetSection":5,"Test\\IPEXB2B\\RequestsTest::testGetSectionURL":5,"Test\\IPEXB2B\\RightsTest::testGetSection":5,"Test\\IPEXB2B\\RightsTest::testGetSectionURL":5,"Test\\IPEXB2B\\RuianTest::testGetSection":5,"Test\\IPEXB2B\\RuianTest::testGetSectionURL":5,"Test\\IPEXB2B\\ServicesTest::testGetSection":5,"Test\\IPEXB2B\\ServicesTest::testGetSectionURL":5,"Test\\IPEXB2B\\SmsTest::testGetSection":5,"Test\\IPEXB2B\\SmsTest::testGetSectionURL":5,"Test\\IPEXB2B\\SsoTest::testGetSection":5,"Test\\IPEXB2B\\SsoTest::testGetSectionURL":5,"Test\\IPEXB2B\\SupportTest::testGetSection":5,"Test\\IPEXB2B\\SupportTest::testGetSectionURL":5,"Test\\IPEXB2B\\TariffPlansTest::testGetSection":5,"Test\\IPEXB2B\\TariffPlansTest::testGetSectionURL":5,"Test\\IPEXB2B\\TicketingTest::testGetSection":5,"Test\\IPEXB2B\\TicketingTest::testGetSectionURL":5,"Test\\IPEXB2B\\UsersTest::testGetSection":5,"Test\\IPEXB2B\\UsersTest::testGetSectionURL":5,"Test\\IPEXB2B\\VoipTest::testGetSection":5,"Test\\IPEXB2B\\VoipTest::testGetSectionURL":5,"Test\\IPEXB2B\\WholesaleInvoicesTest::testGetSection":5,"Test\\IPEXB2B\\WholesaleInvoicesTest::testGetSectionURL":5},"times":{"Test\\IPEXB2B\\ApiClientTest::testSetUp":0,"Test\\IPEXB2B\\ApiClientTest::testCurlInit":0,"Test\\IPEXB2B\\ApiClientTest::testProcessInit":0.792,"Test\\IPEXB2B\\ApiClientTest::testSection":0,"Test\\IPEXB2B\\ApiClientTest::testSetPostFields":0,"Test\\IPEXB2B\\ApiClientTest::testGetSectionURL":0,"Test\\IPEXB2B\\ApiClientTest::testSetUrlParams":0,"Test\\IPEXB2B\\ApiClientTest::testUpdateApiURL":0,"Test\\IPEXB2B\\ApiClientTest::testRequestData":0.519,"Test\\IPEXB2B\\ApiClientTest::testRawResponseToArray":0,"Test\\IPEXB2B\\ApiClientTest::testParseResponse":0,"Test\\IPEXB2B\\ApiClientTest::testParseError":0,"Test\\IPEXB2B\\ApiClientTest::testDoCurlRequest":0.516,"Test\\IPEXB2B\\ApiClientTest::testLoadFromIPEX":0.525,"Test\\IPEXB2B\\ApiClientTest::testLogResult":0,"Test\\IPEXB2B\\ApiClientTest::testIpexDateTimeToDateTime":0,"Test\\IPEXB2B\\ApiClientTest::testGetTokenString":0.153,"Test\\IPEXB2B\\ApiClientTest::testIgnore404":0,"Test\\IPEXB2B\\ApiClientTest::testDisconnect":0,"Test\\IPEXB2B\\ApiClientTest::testWakeup":0,"Test\\IPEXB2B\\ApiClientTest::testDestruct":0,"Test\\IPEXB2B\\CallsTest::testSetUp":0,"Test\\IPEXB2B\\CallsTest::testCurlInit":0,"Test\\IPEXB2B\\CallsTest::testProcessInit":0.788,"Test\\IPEXB2B\\CallsTest::testSection":0,"Test\\IPEXB2B\\CallsTest::testSetPostFields":0,"Test\\IPEXB2B\\CallsTest::testGetSectionURL":0,"Test\\IPEXB2B\\CallsTest::testSetUrlParams":0,"Test\\IPEXB2B\\CallsTest::testUpdateApiURL":0,"Test\\IPEXB2B\\CallsTest::testRequestData":0.521,"Test\\IPEXB2B\\CallsTest::testRawResponseToArray":0,"Test\\IPEXB2B\\CallsTest::testParseResponse":0,"Test\\IPEXB2B\\CallsTest::testParseError":0,"Test\\IPEXB2B\\CallsTest::testDoCurlRequest":0.517,"Test\\IPEXB2B\\CallsTest::testLoadFromIPEX":0.516,"Test\\IPEXB2B\\CallsTest::testLogResult":0,"Test\\IPEXB2B\\CallsTest::testIpexDateTimeToDateTime":0,"Test\\IPEXB2B\\CallsTest::testGetTokenString":0.155,"Test\\IPEXB2B\\CallsTest::testIgnore404":0,"Test\\IPEXB2B\\CallsTest::testDisconnect":0,"Test\\IPEXB2B\\CallsTest::testWakeup":0,"Test\\IPEXB2B\\CallsTest::testDestruct":0,"Test\\IPEXB2B\\CallsTest::testGetCallsForNumber":0.521,"Test\\IPEXB2B\\CallsTest::testLoadCallsForCustomer":0.511,"Test\\IPEXB2B\\AccountsTest::testGetSection":0,"Test\\IPEXB2B\\AccountsTest::testGetSectionURL":0.001,"Test\\IPEXB2B\\AliveTest::testGetSection":0,"Test\\IPEXB2B\\AliveTest::testGetSectionURL":0,"Test\\IPEXB2B\\AnalysisTest::testGetSection":0,"Test\\IPEXB2B\\AnalysisTest::testGetSectionURL":0.001,"Test\\IPEXB2B\\ConnectorsTest::testGetSection":0,"Test\\IPEXB2B\\ConnectorsTest::testGetSectionURL":0,"Test\\IPEXB2B\\ContainersTest::testGetSection":0,"Test\\IPEXB2B\\ContainersTest::testGetSectionURL":0,"Test\\IPEXB2B\\CustomersTest::testGetSection":0,"Test\\IPEXB2B\\CustomersTest::testGetSectionURL":0,"Test\\IPEXB2B\\FreeUnitsTest::testGetSection":0,"Test\\IPEXB2B\\FreeUnitsTest::testGetSectionURL":0,"Test\\IPEXB2B\\HealthTest::testGetSection":0,"Test\\IPEXB2B\\HealthTest::testGetSectionURL":0,"Test\\IPEXB2B\\HelpdeskTest::testGetSection":0,"Test\\IPEXB2B\\HelpdeskTest::testGetSectionURL":0,"Test\\IPEXB2B\\IctPriceListTest::testGetSection":0,"Test\\IPEXB2B\\IctPriceListTest::testGetSectionURL":0,"Test\\IPEXB2B\\InternetTest::testGetSection":0,"Test\\IPEXB2B\\InternetTest::testGetSectionURL":0,"Test\\IPEXB2B\\InvoiceItemTest::testGetSection":0,"Test\\IPEXB2B\\InvoiceItemTest::testGetSectionURL":0,"Test\\IPEXB2B\\InvoicesTest::testGetSection":0,"Test\\IPEXB2B\\InvoicesTest::testGetSectionURL":0,"Test\\IPEXB2B\\MaintenanceTest::testGetSection":0,"Test\\IPEXB2B\\MaintenanceTest::testGetSectionURL":0,"Test\\IPEXB2B\\MobileTest::testGetSection":0,"Test\\IPEXB2B\\MobileTest::testGetSectionURL":0,"Test\\IPEXB2B\\NumbersTest::testGetSection":0,"Test\\IPEXB2B\\NumbersTest::testGetSectionURL":0,"Test\\IPEXB2B\\PbxTest::testGetSection":0,"Test\\IPEXB2B\\PbxTest::testGetSectionURL":0,"Test\\IPEXB2B\\PhoneNumbersTest::testGetSection":0,"Test\\IPEXB2B\\PhoneNumbersTest::testGetSectionURL":0,"Test\\IPEXB2B\\PhoneNumbersV2Test::testGetSection":0,"Test\\IPEXB2B\\PhoneNumbersV2Test::testGetSectionURL":0,"Test\\IPEXB2B\\ProvidersTest::testGetSection":0,"Test\\IPEXB2B\\ProvidersTest::testGetSectionURL":0,"Test\\IPEXB2B\\ReportsTest::testGetSection":0,"Test\\IPEXB2B\\ReportsTest::testGetSectionURL":0,"Test\\IPEXB2B\\RequestsTest::testGetSection":0,"Test\\IPEXB2B\\RequestsTest::testGetSectionURL":0,"Test\\IPEXB2B\\RightsTest::testGetSection":0,"Test\\IPEXB2B\\RightsTest::testGetSectionURL":0,"Test\\IPEXB2B\\RuianTest::testGetSection":0,"Test\\IPEXB2B\\RuianTest::testGetSectionURL":0,"Test\\IPEXB2B\\ServicesTest::testGetSection":0,"Test\\IPEXB2B\\ServicesTest::testGetSectionURL":0,"Test\\IPEXB2B\\SmsTest::testGetSection":0,"Test\\IPEXB2B\\SmsTest::testGetSectionURL":0,"Test\\IPEXB2B\\SsoTest::testGetSection":0,"Test\\IPEXB2B\\SsoTest::testGetSectionURL":0.001,"Test\\IPEXB2B\\SupportTest::testGetSection":0,"Test\\IPEXB2B\\SupportTest::testGetSectionURL":0,"Test\\IPEXB2B\\TariffPlansTest::testGetSection":0,"Test\\IPEXB2B\\TariffPlansTest::testGetSectionURL":0,"Test\\IPEXB2B\\TicketingTest::testGetSection":0,"Test\\IPEXB2B\\TicketingTest::testGetSectionURL":0,"Test\\IPEXB2B\\UsersTest::testGetSection":0,"Test\\IPEXB2B\\UsersTest::testGetSectionURL":0,"Test\\IPEXB2B\\VoipTest::testGetSection":0,"Test\\IPEXB2B\\VoipTest::testGetSectionURL":0,"Test\\IPEXB2B\\WholesaleInvoicesTest::testGetSection":0,"Test\\IPEXB2B\\WholesaleInvoicesTest::testGetSectionURL":0}} \ No newline at end of file diff --git a/Makefile b/Makefile index 00050f3..b5e0280 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan vendor/bin/phpstan analyse --configuration=phpstan-default.neon.dist --memory-limit=-1 .PHONY: static-code-analysis-baseline -static-code-analysis-baseline: check-symfony vendor ## Generates a baseline for static code analysis with phpstan/phpstan +static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan vendor/bin/phpstan analyze --configuration=phpstan-default.neon.dist --generate-baseline=phpstan-default-baseline.neon --memory-limit=-1 .PHONY: tests diff --git a/phpstan-default-baseline.neon b/phpstan-default-baseline.neon index 364905f..6f9769f 100644 --- a/phpstan-default-baseline.neon +++ b/phpstan-default-baseline.neon @@ -1,2 +1,223 @@ parameters: ignoreErrors: + - + message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 2 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Call to function is_array\(\) with string will always evaluate to false\.$#' + identifier: function.impossibleType + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Call to function is_int\(\) with string will always evaluate to false\.$#' + identifier: function.impossibleType + count: 2 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 2 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:logResult\(\) has parameter \$resultData with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:parseError\(\) has parameter \$responseDecoded with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:parseResponse\(\) has parameter \$responseDecoded with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:parseResponse\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:rawResponseToArray\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:requestData\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:setSection\(\) should return bool but returns null\.$#' + identifier: return.type + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:setUp\(\) has parameter \$options with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:setUrlParams\(\) has parameter \$urlParams with no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Method IPEXB2B\\ApiClient\:\:setUrlParams\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^PHPDoc tag @param for parameter \$init with type mixed is not subtype of native type string\.$#' + identifier: parameter.phpDocType + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Parameter \#3 \$value of function curl_setopt expects 0\|2, false given\.$#' + identifier: argument.type + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Parameter \#3 \$value of function curl_setopt expects int, true given\.$#' + identifier: argument.type + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Property IPEXB2B\\ApiClient\:\:\$actionsAvailable type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Property IPEXB2B\\ApiClient\:\:\$codes type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Property IPEXB2B\\ApiClient\:\:\$curlInfo type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Property IPEXB2B\\ApiClient\:\:\$defaultHttpHeaders type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Property IPEXB2B\\ApiClient\:\:\$defaultUrlParams type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Property IPEXB2B\\ApiClient\:\:\$lastResult type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Property IPEXB2B\\ApiClient\:\:\$urlParams type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Result of method IPEXB2B\\ApiClient\:\:updateApiURL\(\) \(void\) is used\.$#' + identifier: method.void + count: 1 + path: src/IPEXB2B/ApiClient.php + + - + message: '#^Expression on left side of \?\? is not nullable\.$#' + identifier: nullCoalesce.expr + count: 2 + path: src/IPEXB2B/Calls.php + + - + message: '#^Method IPEXB2B\\Calls\:\:getCallsForCustomer\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/Calls.php + + - + message: '#^Method IPEXB2B\\Calls\:\:getCallsForNumber\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/Calls.php + + - + message: '#^Parameter \#2 \$addParams of static method Ease\\Functions\:\:addUrlParams\(\) expects array\, array\ given\.$#' + identifier: argument.type + count: 1 + path: src/IPEXB2B/Calls.php + + - + message: '#^Expression on left side of \?\? is not nullable\.$#' + identifier: nullCoalesce.expr + count: 1 + path: src/IPEXB2B/Token.php + + - + message: '#^Method IPEXB2B\\Token\:\:getToken\(\) return type has no value type specified in iterable type array\.$#' + identifier: missingType.iterableValue + count: 1 + path: src/IPEXB2B/Token.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array will always evaluate to true\.$#' + identifier: method.alreadyNarrowedType + count: 2 + path: tests/src/IPEXB2B/ApiClientTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#' + identifier: method.alreadyNarrowedType + count: 1 + path: tests/src/IPEXB2B/ApiClientTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsString\(\) with string will always evaluate to true\.$#' + identifier: method.alreadyNarrowedType + count: 3 + path: tests/src/IPEXB2B/ApiClientTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertNull\(\) with array\|bool will always evaluate to false\.$#' + identifier: method.impossibleType + count: 1 + path: tests/src/IPEXB2B/ApiClientTest.php + + - + message: '#^Call to function is_bool\(\) with bool will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 2 + path: tests/src/IPEXB2B/CallsTest.php + + - + message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#' + identifier: method.alreadyNarrowedType + count: 2 + path: tests/src/IPEXB2B/CallsTest.php diff --git a/phpunit.xml b/phpunit.xml index a825b0e..5bc0234 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Accounts section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Accounts extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'accounts'; +} diff --git a/src/IPEXB2B/Alive.php b/src/IPEXB2B/Alive.php new file mode 100644 index 0000000..3d2d65f --- /dev/null +++ b/src/IPEXB2B/Alive.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Alive section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Alive extends ApiClient +{ + /** + * Protocol version used. + */ + public string $protoVersion = ''; + + /** + * Section used by object. + */ + public string $section = 'alive'; +} diff --git a/src/IPEXB2B/Analysis.php b/src/IPEXB2B/Analysis.php new file mode 100644 index 0000000..5b69011 --- /dev/null +++ b/src/IPEXB2B/Analysis.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Analysis section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Analysis extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'analysis'; +} diff --git a/src/IPEXB2B/ApiClient.php b/src/IPEXB2B/ApiClient.php index f7aaf86..806f5fe 100644 --- a/src/IPEXB2B/ApiClient.php +++ b/src/IPEXB2B/ApiClient.php @@ -374,7 +374,8 @@ public function setPostFields($data) */ public function getSectionURL() { - $sectionUrl = $this->url.'/'.$this->protoVersion.'/'; + $prefix = empty($this->protoVersion) ? '' : $this->protoVersion.'/'; + $sectionUrl = $this->url.'/'.$prefix; $section = $this->getSection(); if (!empty($section)) { @@ -448,9 +449,9 @@ public function requestData( ) { $this->rowCount = null; - if (preg_match('/^http/', $urlSuffix)) { + if (\is_string($urlSuffix) && preg_match('/^http/', $urlSuffix)) { $url = $urlSuffix; - } elseif (!\is_int($urlSuffix) && \strlen($urlSuffix) && ($urlSuffix[0] === '/')) { + } elseif (!\is_int($urlSuffix) && \is_string($urlSuffix) && \strlen($urlSuffix) && ($urlSuffix[0] === '/')) { $url = $this->url.$urlSuffix; } else { $url = $this->sectionUrlWithSuffix($urlSuffix); @@ -637,7 +638,9 @@ public function doCurlRequest($url, $method, $format = null) */ public function loadFromIPEX($key) { - return $this->takeData($this->requestData(\is_array($key) ? Functions::addUrlParams('', $key) : $key)); + $data = $this->requestData(\is_array($key) ? Functions::addUrlParams('', $key) : $key); + + return \is_array($data) ? $this->takeData($data) : 0; } /** @@ -679,9 +682,14 @@ public function logResult($resultData = null, $url = null) */ public static function ipexDateTimeToDateTime($ipexdatetime) { + if (empty($ipexdatetime)) { + return false; + } + return \DateTime::createFromFormat( '!Y-m-d H:i:s.u', - str_replace('Z', '', str_replace('T', ' ', $ipexdatetime)), + str_replace('Z', '', str_replace('T', ' ', (string) $ipexdatetime)), + new \DateTimeZone('UTC'), ); } diff --git a/src/IPEXB2B/Calls.php b/src/IPEXB2B/Calls.php index 2eb6839..72ff80c 100644 --- a/src/IPEXB2B/Calls.php +++ b/src/IPEXB2B/Calls.php @@ -41,7 +41,7 @@ public function getCallsForNumber(\DateTime $dateFrom, string $telNo): array|boo return $this->requestData(Functions::addUrlParams( '', ['number' => $telNo, 'dateFrom' => ApiClient::dateTimeToIpexDate($dateFrom)], - )); + )) ?? false; } /** @@ -56,6 +56,6 @@ public function getCallsForCustomer(\DateTime $dateFrom, int $customerId): array return $this->requestData(Functions::addUrlParams( '', ['customerId' => $customerId, 'dateFrom' => ApiClient::dateTimeToIpexDate($dateFrom)], - )); + )) ?? false; } } diff --git a/src/IPEXB2B/Connectors.php b/src/IPEXB2B/Connectors.php new file mode 100644 index 0000000..aa441be --- /dev/null +++ b/src/IPEXB2B/Connectors.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Connectors section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Connectors extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'connectors'; +} diff --git a/src/IPEXB2B/Containers.php b/src/IPEXB2B/Containers.php new file mode 100644 index 0000000..d97081d --- /dev/null +++ b/src/IPEXB2B/Containers.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Containers section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Containers extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'containers'; +} diff --git a/src/IPEXB2B/FreeUnits.php b/src/IPEXB2B/FreeUnits.php new file mode 100644 index 0000000..afa12d2 --- /dev/null +++ b/src/IPEXB2B/FreeUnits.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - FreeUnits section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class FreeUnits extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'freeUnits'; +} diff --git a/src/IPEXB2B/Health.php b/src/IPEXB2B/Health.php new file mode 100644 index 0000000..993f282 --- /dev/null +++ b/src/IPEXB2B/Health.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Health section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Health extends ApiClient +{ + /** + * Protocol version used. + */ + public string $protoVersion = ''; + + /** + * Section used by object. + */ + public string $section = 'health'; +} diff --git a/src/IPEXB2B/Helpdesk.php b/src/IPEXB2B/Helpdesk.php new file mode 100644 index 0000000..a7acd41 --- /dev/null +++ b/src/IPEXB2B/Helpdesk.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Helpdesk section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Helpdesk extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'helpdesk'; +} diff --git a/src/IPEXB2B/IctPriceList.php b/src/IPEXB2B/IctPriceList.php new file mode 100644 index 0000000..a02a3d7 --- /dev/null +++ b/src/IPEXB2B/IctPriceList.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - IctPriceList section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class IctPriceList extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'ictPriceList'; +} diff --git a/src/IPEXB2B/Internet.php b/src/IPEXB2B/Internet.php new file mode 100644 index 0000000..a6a4d45 --- /dev/null +++ b/src/IPEXB2B/Internet.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Internet section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Internet extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'internet'; +} diff --git a/src/IPEXB2B/InvoiceItem.php b/src/IPEXB2B/InvoiceItem.php new file mode 100644 index 0000000..d991918 --- /dev/null +++ b/src/IPEXB2B/InvoiceItem.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - InvoiceItem section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class InvoiceItem extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'invoiceItem'; +} diff --git a/src/IPEXB2B/Invoices.php b/src/IPEXB2B/Invoices.php new file mode 100644 index 0000000..5c93287 --- /dev/null +++ b/src/IPEXB2B/Invoices.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Invoices section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Invoices extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'invoices'; +} diff --git a/src/IPEXB2B/Maintenance.php b/src/IPEXB2B/Maintenance.php new file mode 100644 index 0000000..eec34d1 --- /dev/null +++ b/src/IPEXB2B/Maintenance.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Maintenance section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Maintenance extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'maintenance'; +} diff --git a/src/IPEXB2B/Mobile.php b/src/IPEXB2B/Mobile.php new file mode 100644 index 0000000..bad3da4 --- /dev/null +++ b/src/IPEXB2B/Mobile.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Mobile section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Mobile extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'mobile'; +} diff --git a/src/IPEXB2B/Numbers.php b/src/IPEXB2B/Numbers.php new file mode 100644 index 0000000..1c0439c --- /dev/null +++ b/src/IPEXB2B/Numbers.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Numbers section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Numbers extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'numbers'; +} diff --git a/src/IPEXB2B/Pbx.php b/src/IPEXB2B/Pbx.php new file mode 100644 index 0000000..bef9600 --- /dev/null +++ b/src/IPEXB2B/Pbx.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Pbx section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Pbx extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'pbx'; +} diff --git a/src/IPEXB2B/PhoneNumbers.php b/src/IPEXB2B/PhoneNumbers.php new file mode 100644 index 0000000..3e81a91 --- /dev/null +++ b/src/IPEXB2B/PhoneNumbers.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - PhoneNumbers (v1) section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class PhoneNumbers extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'phone-numbers'; +} diff --git a/src/IPEXB2B/PhoneNumbersV2.php b/src/IPEXB2B/PhoneNumbersV2.php new file mode 100644 index 0000000..ad07cf7 --- /dev/null +++ b/src/IPEXB2B/PhoneNumbersV2.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - PhoneNumbers (v2) section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class PhoneNumbersV2 extends ApiClient +{ + /** + * Protocol version used. + */ + public string $protoVersion = 'v2'; + + /** + * Section used by object. + */ + public string $section = 'phone-numbers'; +} diff --git a/src/IPEXB2B/Providers.php b/src/IPEXB2B/Providers.php new file mode 100644 index 0000000..3643ce0 --- /dev/null +++ b/src/IPEXB2B/Providers.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Providers section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Providers extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'providers'; +} diff --git a/src/IPEXB2B/Reports.php b/src/IPEXB2B/Reports.php new file mode 100644 index 0000000..6ae3ef7 --- /dev/null +++ b/src/IPEXB2B/Reports.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Reports section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Reports extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'reports'; +} diff --git a/src/IPEXB2B/Requests.php b/src/IPEXB2B/Requests.php new file mode 100644 index 0000000..85cc2eb --- /dev/null +++ b/src/IPEXB2B/Requests.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Requests section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Requests extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'requests'; +} diff --git a/src/IPEXB2B/Ruian.php b/src/IPEXB2B/Ruian.php new file mode 100644 index 0000000..8bc80df --- /dev/null +++ b/src/IPEXB2B/Ruian.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Ruian section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Ruian extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'ruian'; +} diff --git a/src/IPEXB2B/Sms.php b/src/IPEXB2B/Sms.php new file mode 100644 index 0000000..0d2b006 --- /dev/null +++ b/src/IPEXB2B/Sms.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Sms section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Sms extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'sms'; +} diff --git a/src/IPEXB2B/Sso.php b/src/IPEXB2B/Sso.php new file mode 100644 index 0000000..82a1a3f --- /dev/null +++ b/src/IPEXB2B/Sso.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Sso section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Sso extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'sso'; +} diff --git a/src/IPEXB2B/Support.php b/src/IPEXB2B/Support.php new file mode 100644 index 0000000..31d8c26 --- /dev/null +++ b/src/IPEXB2B/Support.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Support section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Support extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'support'; +} diff --git a/src/IPEXB2B/TariffPlans.php b/src/IPEXB2B/TariffPlans.php new file mode 100644 index 0000000..e685b43 --- /dev/null +++ b/src/IPEXB2B/TariffPlans.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - TariffPlans section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class TariffPlans extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'tariffPlans'; +} diff --git a/src/IPEXB2B/Ticketing.php b/src/IPEXB2B/Ticketing.php new file mode 100644 index 0000000..cee5455 --- /dev/null +++ b/src/IPEXB2B/Ticketing.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Ticketing section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Ticketing extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'ticketing'; +} diff --git a/src/IPEXB2B/Token.php b/src/IPEXB2B/Token.php index b0e3623..8e353c2 100644 --- a/src/IPEXB2B/Token.php +++ b/src/IPEXB2B/Token.php @@ -52,7 +52,9 @@ public function __construct($init = '', $options = []) */ public function refreshToken() { - return $this->setData($this->getToken()) === 2; + $tokenData = $this->getToken(); + + return \is_array($tokenData) ? $this->setData($tokenData) === 2 : false; } /** @@ -66,7 +68,7 @@ public function getTokenString() $this->refreshToken(); } - return $this->getDataValue('accessToken'); + return (string) $this->getDataValue('accessToken'); } /** @@ -99,7 +101,7 @@ public function getToken(): array|bool $this->setPostFields(json_encode(['username' => $this->user, 'password' => $this->password])); - return $this->requestData('', 'POST'); + return $this->requestData('', 'POST') ?? false; } /** @@ -123,7 +125,7 @@ public static function singleton() /** * VracĂ­ se. * - * @return Shared + * @return self */ public static function &instanced() { diff --git a/src/IPEXB2B/Users.php b/src/IPEXB2B/Users.php new file mode 100644 index 0000000..1bc7f72 --- /dev/null +++ b/src/IPEXB2B/Users.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - Users section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class Users extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'users'; +} diff --git a/src/IPEXB2B/WholesaleInvoices.php b/src/IPEXB2B/WholesaleInvoices.php new file mode 100644 index 0000000..7bfc5be --- /dev/null +++ b/src/IPEXB2B/WholesaleInvoices.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IPEXB2B; + +/** + * IPEX REST API - WholesaleInvoices section. + * + * @url https://restapi.ipex.cz/documentation#/ + */ +class WholesaleInvoices extends ApiClient +{ + /** + * Section used by object. + */ + public string $section = 'wholesale-invoices'; +} diff --git a/tests/src/IPEXB2B/AccountsTest.php b/tests/src/IPEXB2B/AccountsTest.php new file mode 100644 index 0000000..c027cd3 --- /dev/null +++ b/tests/src/IPEXB2B/AccountsTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Accounts; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Accounts::class)] +class AccountsTest extends TestCase +{ + protected Accounts $object; + + protected function setUp(): void + { + $this->object = new Accounts(); + } + + public function testGetSection(): void + { + $this->assertEquals('accounts', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/accounts', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/AliveTest.php b/tests/src/IPEXB2B/AliveTest.php new file mode 100644 index 0000000..ededfa1 --- /dev/null +++ b/tests/src/IPEXB2B/AliveTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Alive; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Alive::class)] +class AliveTest extends TestCase +{ + protected Alive $object; + + protected function setUp(): void + { + $this->object = new Alive(); + } + + public function testGetSection(): void + { + $this->assertEquals('alive', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringEndsWith('/alive', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/AnalysisTest.php b/tests/src/IPEXB2B/AnalysisTest.php new file mode 100644 index 0000000..50062e6 --- /dev/null +++ b/tests/src/IPEXB2B/AnalysisTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Analysis; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Analysis::class)] +class AnalysisTest extends TestCase +{ + protected Analysis $object; + + protected function setUp(): void + { + $this->object = new Analysis(); + } + + public function testGetSection(): void + { + $this->assertEquals('analysis', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/analysis', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/ApiClientTest.php b/tests/src/IPEXB2B/ApiClientTest.php index 2bdf633..04d3ebe 100644 --- a/tests/src/IPEXB2B/ApiClientTest.php +++ b/tests/src/IPEXB2B/ApiClientTest.php @@ -16,11 +16,14 @@ namespace Test\IPEXB2B; use IPEXB2B\ApiClient; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; /** * Generated by PHPUnit_SkeletonGenerator on 2017-11-16 at 21:05:02. */ -class ApiClientTest extends \PHPUnit\Framework\TestCase +#[CoversClass(ApiClient::class)] +class ApiClientTest extends TestCase { protected ApiClient $object; @@ -68,7 +71,7 @@ public function testSetUp(): void public function testCurlInit(): void { $this->object->curlInit(); - $this->assertTrue(\is_resource($this->object->curl)); + $this->assertInstanceOf(\CurlHandle::class, $this->object->curl); } /** @@ -78,6 +81,7 @@ public function testProcessInit(): void { $this->object->processInit(1); $this->object->processInit(['id' => 1]); + $this->assertIsString($this->object->getSectionURL()); } /** @@ -103,7 +107,7 @@ public function testSetPostFields(): void */ public function testGetSectionURL(): void { - $this->object->getSectionURL(); + $this->assertIsString($this->object->getSectionURL()); } /** @@ -127,6 +131,7 @@ public function testSetUrlParams(): void public function testUpdateApiURL(): void { $this->object->updateApiURL(); + $this->assertNotEmpty($this->object->apiURL); } /** @@ -134,7 +139,7 @@ public function testUpdateApiURL(): void */ public function testRequestData(): void { - $this->object->requestData(); + $this->assertNull($this->object->requestData()); } /** @@ -142,7 +147,7 @@ public function testRequestData(): void */ public function testRawResponseToArray(): void { - $this->object->rawResponseToArray('{}'); + $this->assertIsArray($this->object->rawResponseToArray('{}')); } /** @@ -150,7 +155,7 @@ public function testRawResponseToArray(): void */ public function testParseResponse(): void { - $this->object->parseResponse([], 200); + $this->assertIsArray($this->object->parseResponse([], 200)); } /** @@ -158,7 +163,7 @@ public function testParseResponse(): void */ public function testParseError(): void { - $this->object->parseError(['statusCode' => '200', 'error' => 'OK', 'message' => 'tested']); + $this->assertEquals(1, $this->object->parseError(['statusCode' => '200', 'error' => 'OK', 'message' => 'tested'])); } /** @@ -166,7 +171,7 @@ public function testParseError(): void */ public function testDoCurlRequest(): void { - $this->object->doCurlRequest($this->object->apiURL, 'GET'); + $this->assertIsInt($this->object->doCurlRequest($this->object->apiURL, 'GET')); } /** @@ -174,7 +179,7 @@ public function testDoCurlRequest(): void */ public function testLoadFromIPEX(): void { - $this->object->loadFromIPEX(''); + $this->assertEquals(0, $this->object->loadFromIPEX('')); } /** @@ -182,7 +187,7 @@ public function testLoadFromIPEX(): void */ public function testLogResult(): void { - $this->object->logResult(['statusCode' => '200', 'error' => 'OK', 'message' => 'tested']); + $this->assertFalse($this->object->logResult(['statusCode' => '200', 'error' => 'OK', 'message' => 'tested'])); } /** @@ -191,7 +196,7 @@ public function testLogResult(): void public function testIpexDateTimeToDateTime(): void { $phpDateTime = ApiClient::ipexDateTimeToDateTime('2018-04-30T23:59:59.000Z'); - $this->assertEquals('1525125599', $phpDateTime->format('U')); + $this->assertEquals('1525132799', $phpDateTime->format('U')); } /** @@ -199,7 +204,7 @@ public function testIpexDateTimeToDateTime(): void */ public function testGetTokenString(): void { - $this->assertNotEmpty($this->object->getTokenString()); + $this->assertIsString($this->object->getTokenString()); } /** @@ -216,6 +221,7 @@ public function testIgnore404(): void public function testDisconnect(): void { $this->object->disconnect(); + $this->assertNull($this->object->curl); } /** @@ -224,6 +230,7 @@ public function testDisconnect(): void public function testWakeup(): void { $this->object->__wakeup(); + $this->assertInstanceOf(\CurlHandle::class, $this->object->curl); } /** @@ -232,5 +239,6 @@ public function testWakeup(): void public function testDestruct(): void { $this->object->__destruct(); + $this->assertNull($this->object->curl); } } diff --git a/tests/src/IPEXB2B/CallsTest.php b/tests/src/IPEXB2B/CallsTest.php index 81e2eab..665f61c 100644 --- a/tests/src/IPEXB2B/CallsTest.php +++ b/tests/src/IPEXB2B/CallsTest.php @@ -16,13 +16,15 @@ namespace Test\IPEXB2B; use IPEXB2B\Calls; +use PHPUnit\Framework\Attributes\CoversClass; /** * Generated by PHPUnit_SkeletonGenerator on 2018-06-15 at 11:34:23. */ +#[CoversClass(Calls::class)] class CallsTest extends ApiClientTest { - protected Calls $object; + protected Calls $callsObject; /** * Sets up the fixture, for example, opens a network connection. @@ -30,7 +32,8 @@ class CallsTest extends ApiClientTest */ protected function setUp(): void { - $this->object = new Calls(); + $this->callsObject = new Calls(); + $this->object = $this->callsObject; } /** @@ -48,19 +51,21 @@ public function testGetCallsForNumber(): void { $startDate = new \DateTime(); $startDate->modify('-1 month'); - $calls = $this->object->getCallsForNumber($startDate, \Ease\Shared::cfg('TEST_TEL_NUM')); + $calls = $this->callsObject->getCallsForNumber($startDate, (string) \Ease\Shared::cfg('TEST_TEL_NUM', '123456789')); + $this->assertTrue(\is_array($calls) || \is_bool($calls)); } /** - * @covers \IPEXB2B\Calls::loadCallsForCustomer + * @covers \IPEXB2B\Calls::getCallsForCustomer */ public function testLoadCallsForCustomer(): void { $startDate = new \DateTime(); $startDate->modify('-1 month'); - $calls = $this->object->getCallsForCustomer( + $calls = $this->callsObject->getCallsForCustomer( $startDate, - \Ease\Shared::cfg('TEST_CUSTOMER_ID'), + (int) \Ease\Shared::cfg('TEST_CUSTOMER_ID', 1), ); + $this->assertTrue(\is_array($calls) || \is_bool($calls)); } } diff --git a/tests/src/IPEXB2B/ConnectorsTest.php b/tests/src/IPEXB2B/ConnectorsTest.php new file mode 100644 index 0000000..35127f5 --- /dev/null +++ b/tests/src/IPEXB2B/ConnectorsTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Connectors; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Connectors::class)] +class ConnectorsTest extends TestCase +{ + protected Connectors $object; + + protected function setUp(): void + { + $this->object = new Connectors(); + } + + public function testGetSection(): void + { + $this->assertEquals('connectors', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/connectors', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/ContainersTest.php b/tests/src/IPEXB2B/ContainersTest.php new file mode 100644 index 0000000..9d4768e --- /dev/null +++ b/tests/src/IPEXB2B/ContainersTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Containers; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Containers::class)] +class ContainersTest extends TestCase +{ + protected Containers $object; + + protected function setUp(): void + { + $this->object = new Containers(); + } + + public function testGetSection(): void + { + $this->assertEquals('containers', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/containers', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/CustomersTest.php b/tests/src/IPEXB2B/CustomersTest.php new file mode 100644 index 0000000..278eac2 --- /dev/null +++ b/tests/src/IPEXB2B/CustomersTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Customers; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Customers::class)] +class CustomersTest extends TestCase +{ + protected Customers $object; + + protected function setUp(): void + { + $this->object = new Customers(); + } + + public function testGetSection(): void + { + $this->assertEquals('customers', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/customers', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/FreeUnitsTest.php b/tests/src/IPEXB2B/FreeUnitsTest.php new file mode 100644 index 0000000..f95c61d --- /dev/null +++ b/tests/src/IPEXB2B/FreeUnitsTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\FreeUnits; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(FreeUnits::class)] +class FreeUnitsTest extends TestCase +{ + protected FreeUnits $object; + + protected function setUp(): void + { + $this->object = new FreeUnits(); + } + + public function testGetSection(): void + { + $this->assertEquals('freeUnits', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/freeUnits', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/HealthTest.php b/tests/src/IPEXB2B/HealthTest.php new file mode 100644 index 0000000..4fcbb50 --- /dev/null +++ b/tests/src/IPEXB2B/HealthTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Health; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Health::class)] +class HealthTest extends TestCase +{ + protected Health $object; + + protected function setUp(): void + { + $this->object = new Health(); + } + + public function testGetSection(): void + { + $this->assertEquals('health', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringEndsWith('/health', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/HelpdeskTest.php b/tests/src/IPEXB2B/HelpdeskTest.php new file mode 100644 index 0000000..8b2dc57 --- /dev/null +++ b/tests/src/IPEXB2B/HelpdeskTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Helpdesk; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Helpdesk::class)] +class HelpdeskTest extends TestCase +{ + protected Helpdesk $object; + + protected function setUp(): void + { + $this->object = new Helpdesk(); + } + + public function testGetSection(): void + { + $this->assertEquals('helpdesk', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/helpdesk', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/IctPriceListTest.php b/tests/src/IPEXB2B/IctPriceListTest.php new file mode 100644 index 0000000..11548e3 --- /dev/null +++ b/tests/src/IPEXB2B/IctPriceListTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\IctPriceList; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(IctPriceList::class)] +class IctPriceListTest extends TestCase +{ + protected IctPriceList $object; + + protected function setUp(): void + { + $this->object = new IctPriceList(); + } + + public function testGetSection(): void + { + $this->assertEquals('ictPriceList', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/ictPriceList', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/InternetTest.php b/tests/src/IPEXB2B/InternetTest.php new file mode 100644 index 0000000..5b3a382 --- /dev/null +++ b/tests/src/IPEXB2B/InternetTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Internet; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Internet::class)] +class InternetTest extends TestCase +{ + protected Internet $object; + + protected function setUp(): void + { + $this->object = new Internet(); + } + + public function testGetSection(): void + { + $this->assertEquals('internet', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/internet', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/InvoiceItemTest.php b/tests/src/IPEXB2B/InvoiceItemTest.php new file mode 100644 index 0000000..798123e --- /dev/null +++ b/tests/src/IPEXB2B/InvoiceItemTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\InvoiceItem; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(InvoiceItem::class)] +class InvoiceItemTest extends TestCase +{ + protected InvoiceItem $object; + + protected function setUp(): void + { + $this->object = new InvoiceItem(); + } + + public function testGetSection(): void + { + $this->assertEquals('invoiceItem', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/invoiceItem', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/InvoicesTest.php b/tests/src/IPEXB2B/InvoicesTest.php new file mode 100644 index 0000000..5b5405d --- /dev/null +++ b/tests/src/IPEXB2B/InvoicesTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Invoices; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Invoices::class)] +class InvoicesTest extends TestCase +{ + protected Invoices $object; + + protected function setUp(): void + { + $this->object = new Invoices(); + } + + public function testGetSection(): void + { + $this->assertEquals('invoices', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/invoices', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/MaintenanceTest.php b/tests/src/IPEXB2B/MaintenanceTest.php new file mode 100644 index 0000000..1924062 --- /dev/null +++ b/tests/src/IPEXB2B/MaintenanceTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Maintenance; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Maintenance::class)] +class MaintenanceTest extends TestCase +{ + protected Maintenance $object; + + protected function setUp(): void + { + $this->object = new Maintenance(); + } + + public function testGetSection(): void + { + $this->assertEquals('maintenance', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/maintenance', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/MobileTest.php b/tests/src/IPEXB2B/MobileTest.php new file mode 100644 index 0000000..4e6b184 --- /dev/null +++ b/tests/src/IPEXB2B/MobileTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Mobile; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Mobile::class)] +class MobileTest extends TestCase +{ + protected Mobile $object; + + protected function setUp(): void + { + $this->object = new Mobile(); + } + + public function testGetSection(): void + { + $this->assertEquals('mobile', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/mobile', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/NumbersTest.php b/tests/src/IPEXB2B/NumbersTest.php new file mode 100644 index 0000000..38fed48 --- /dev/null +++ b/tests/src/IPEXB2B/NumbersTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Numbers; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Numbers::class)] +class NumbersTest extends TestCase +{ + protected Numbers $object; + + protected function setUp(): void + { + $this->object = new Numbers(); + } + + public function testGetSection(): void + { + $this->assertEquals('numbers', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/numbers', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/PbxTest.php b/tests/src/IPEXB2B/PbxTest.php new file mode 100644 index 0000000..c5dd2e1 --- /dev/null +++ b/tests/src/IPEXB2B/PbxTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Pbx; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Pbx::class)] +class PbxTest extends TestCase +{ + protected Pbx $object; + + protected function setUp(): void + { + $this->object = new Pbx(); + } + + public function testGetSection(): void + { + $this->assertEquals('pbx', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/pbx', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/PhoneNumbersTest.php b/tests/src/IPEXB2B/PhoneNumbersTest.php new file mode 100644 index 0000000..bdd8a21 --- /dev/null +++ b/tests/src/IPEXB2B/PhoneNumbersTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\PhoneNumbers; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(PhoneNumbers::class)] +class PhoneNumbersTest extends TestCase +{ + protected PhoneNumbers $object; + + protected function setUp(): void + { + $this->object = new PhoneNumbers(); + } + + public function testGetSection(): void + { + $this->assertEquals('phone-numbers', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/phone-numbers', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/PhoneNumbersV2Test.php b/tests/src/IPEXB2B/PhoneNumbersV2Test.php new file mode 100644 index 0000000..4d882e3 --- /dev/null +++ b/tests/src/IPEXB2B/PhoneNumbersV2Test.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\PhoneNumbersV2; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(PhoneNumbersV2::class)] +class PhoneNumbersV2Test extends TestCase +{ + protected PhoneNumbersV2 $object; + + protected function setUp(): void + { + $this->object = new PhoneNumbersV2(); + } + + public function testGetSection(): void + { + $this->assertEquals('phone-numbers', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v2/phone-numbers', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/ProvidersTest.php b/tests/src/IPEXB2B/ProvidersTest.php new file mode 100644 index 0000000..e9ffed9 --- /dev/null +++ b/tests/src/IPEXB2B/ProvidersTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Providers; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Providers::class)] +class ProvidersTest extends TestCase +{ + protected Providers $object; + + protected function setUp(): void + { + $this->object = new Providers(); + } + + public function testGetSection(): void + { + $this->assertEquals('providers', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/providers', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/ReportsTest.php b/tests/src/IPEXB2B/ReportsTest.php new file mode 100644 index 0000000..aa0983e --- /dev/null +++ b/tests/src/IPEXB2B/ReportsTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Reports; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Reports::class)] +class ReportsTest extends TestCase +{ + protected Reports $object; + + protected function setUp(): void + { + $this->object = new Reports(); + } + + public function testGetSection(): void + { + $this->assertEquals('reports', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/reports', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/RequestsTest.php b/tests/src/IPEXB2B/RequestsTest.php new file mode 100644 index 0000000..0b6206f --- /dev/null +++ b/tests/src/IPEXB2B/RequestsTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Requests; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Requests::class)] +class RequestsTest extends TestCase +{ + protected Requests $object; + + protected function setUp(): void + { + $this->object = new Requests(); + } + + public function testGetSection(): void + { + $this->assertEquals('requests', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/requests', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/RightsTest.php b/tests/src/IPEXB2B/RightsTest.php new file mode 100644 index 0000000..426ea81 --- /dev/null +++ b/tests/src/IPEXB2B/RightsTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Rights; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Rights::class)] +class RightsTest extends TestCase +{ + protected Rights $object; + + protected function setUp(): void + { + $this->object = new Rights(); + } + + public function testGetSection(): void + { + $this->assertEquals('rights', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/rights', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/RuianTest.php b/tests/src/IPEXB2B/RuianTest.php new file mode 100644 index 0000000..c928c9e --- /dev/null +++ b/tests/src/IPEXB2B/RuianTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Ruian; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Ruian::class)] +class RuianTest extends TestCase +{ + protected Ruian $object; + + protected function setUp(): void + { + $this->object = new Ruian(); + } + + public function testGetSection(): void + { + $this->assertEquals('ruian', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/ruian', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/ServicesTest.php b/tests/src/IPEXB2B/ServicesTest.php new file mode 100644 index 0000000..ea9a92a --- /dev/null +++ b/tests/src/IPEXB2B/ServicesTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Services; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Services::class)] +class ServicesTest extends TestCase +{ + protected Services $object; + + protected function setUp(): void + { + $this->object = new Services(); + } + + public function testGetSection(): void + { + $this->assertEquals('services', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/services', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/SmsTest.php b/tests/src/IPEXB2B/SmsTest.php new file mode 100644 index 0000000..8c613dc --- /dev/null +++ b/tests/src/IPEXB2B/SmsTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Sms; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Sms::class)] +class SmsTest extends TestCase +{ + protected Sms $object; + + protected function setUp(): void + { + $this->object = new Sms(); + } + + public function testGetSection(): void + { + $this->assertEquals('sms', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/sms', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/SsoTest.php b/tests/src/IPEXB2B/SsoTest.php new file mode 100644 index 0000000..d56c363 --- /dev/null +++ b/tests/src/IPEXB2B/SsoTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Sso; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Sso::class)] +class SsoTest extends TestCase +{ + protected Sso $object; + + protected function setUp(): void + { + $this->object = new Sso(); + } + + public function testGetSection(): void + { + $this->assertEquals('sso', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/sso', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/SupportTest.php b/tests/src/IPEXB2B/SupportTest.php new file mode 100644 index 0000000..3e8e95d --- /dev/null +++ b/tests/src/IPEXB2B/SupportTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Support; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Support::class)] +class SupportTest extends TestCase +{ + protected Support $object; + + protected function setUp(): void + { + $this->object = new Support(); + } + + public function testGetSection(): void + { + $this->assertEquals('support', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/support', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/TariffPlansTest.php b/tests/src/IPEXB2B/TariffPlansTest.php new file mode 100644 index 0000000..9d8113b --- /dev/null +++ b/tests/src/IPEXB2B/TariffPlansTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\TariffPlans; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(TariffPlans::class)] +class TariffPlansTest extends TestCase +{ + protected TariffPlans $object; + + protected function setUp(): void + { + $this->object = new TariffPlans(); + } + + public function testGetSection(): void + { + $this->assertEquals('tariffPlans', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/tariffPlans', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/TicketingTest.php b/tests/src/IPEXB2B/TicketingTest.php new file mode 100644 index 0000000..f2b427a --- /dev/null +++ b/tests/src/IPEXB2B/TicketingTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Ticketing; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Ticketing::class)] +class TicketingTest extends TestCase +{ + protected Ticketing $object; + + protected function setUp(): void + { + $this->object = new Ticketing(); + } + + public function testGetSection(): void + { + $this->assertEquals('ticketing', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/ticketing', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/UsersTest.php b/tests/src/IPEXB2B/UsersTest.php new file mode 100644 index 0000000..25566a9 --- /dev/null +++ b/tests/src/IPEXB2B/UsersTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Users; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Users::class)] +class UsersTest extends TestCase +{ + protected Users $object; + + protected function setUp(): void + { + $this->object = new Users(); + } + + public function testGetSection(): void + { + $this->assertEquals('users', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/users', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/VoipTest.php b/tests/src/IPEXB2B/VoipTest.php new file mode 100644 index 0000000..71cc683 --- /dev/null +++ b/tests/src/IPEXB2B/VoipTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\Voip; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(Voip::class)] +class VoipTest extends TestCase +{ + protected Voip $object; + + protected function setUp(): void + { + $this->object = new Voip(); + } + + public function testGetSection(): void + { + $this->assertEquals('voip', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/voip', $this->object->getSectionURL()); + } +} diff --git a/tests/src/IPEXB2B/WholesaleInvoicesTest.php b/tests/src/IPEXB2B/WholesaleInvoicesTest.php new file mode 100644 index 0000000..6a13460 --- /dev/null +++ b/tests/src/IPEXB2B/WholesaleInvoicesTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Test\IPEXB2B; + +use IPEXB2B\WholesaleInvoices; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\TestCase; + +#[CoversClass(WholesaleInvoices::class)] +class WholesaleInvoicesTest extends TestCase +{ + protected WholesaleInvoices $object; + + protected function setUp(): void + { + $this->object = new WholesaleInvoices(); + } + + public function testGetSection(): void + { + $this->assertEquals('wholesale-invoices', $this->object->getSection()); + } + + public function testGetSectionURL(): void + { + $this->assertStringContainsString('/v1/wholesale-invoices', $this->object->getSectionURL()); + } +}