diff --git a/tests/adoria/Serializer/RequestSerializerTest.php b/tests/adoria/Serializer/RequestSerializerTest.php index b15fd1fd7..6c43fe29b 100644 --- a/tests/adoria/Serializer/RequestSerializerTest.php +++ b/tests/adoria/Serializer/RequestSerializerTest.php @@ -46,6 +46,7 @@ public function testSerializeRequestData(): void { "BuyDateMax" => "2019-01-22", "IdentificationKey" => "identificationKey", ]; + $this->assertEquals($exp, $obj); } diff --git a/tests/curl/Request/PostRequestTest.php b/tests/curl/Request/PostRequestTest.php index 0ba2d8330..fe80cd8d4 100644 --- a/tests/curl/Request/PostRequestTest.php +++ b/tests/curl/Request/PostRequestTest.php @@ -36,6 +36,7 @@ public function testAddPostData(): void { $obj->addPostData("name", "value"); $exp = ["name" => "value"]; + $this->assertEquals($exp, $obj->getPostData()); } diff --git a/tests/database/Connector/MicrosoftAccessDatabaseConnectorTest.php b/tests/database/Connector/MicrosoftAccessDatabaseConnectorTest.php index e3dc02391..a734621ce 100644 --- a/tests/database/Connector/MicrosoftAccessDatabaseConnectorTest.php +++ b/tests/database/Connector/MicrosoftAccessDatabaseConnectorTest.php @@ -73,11 +73,11 @@ public function testGetConnectionWithPDOException(): void { */ public function testPrepareBinding(): void { + $obj = new MicrosoftAccessDatabaseConnector($this->authenticator, null); + $arg = ["field1", "field2", "field3"]; $exp = ["field1" => ":field1", "field2" => ":field2", "field3" => ":field3"]; - $obj = new MicrosoftAccessDatabaseConnector($this->authenticator, null); - $this->assertEquals($exp, $obj->prepareBinding($arg)); } @@ -88,11 +88,11 @@ public function testPrepareBinding(): void { */ public function testPrepareInsert(): void { + $obj = new MicrosoftAccessDatabaseConnector($this->authenticator, null); + $arg = ["field1" => 1, "field2" => "'value2'", "field3" => "'value3'"]; $exp = "INSERT INTO table (`field1`, `field2`, `field3`) VALUES (1, 'value2', 'value3')"; - $obj = new MicrosoftAccessDatabaseConnector($this->authenticator, null); - $this->assertEquals($exp, $obj->prepareInsert("table", $arg)); } @@ -107,6 +107,7 @@ public function testPrepareUpdate(): void { $arg = ["field1" => 1, "field2" => "'value2'", "field3" => "'value3'"]; $exp = "UPDATE table SET `field1` = 1, `field2` = 'value2', `field3` = 'value3'"; + $this->assertEquals($exp, $obj->prepareUpdate("table", $arg)); } diff --git a/tests/image/Helper/ImageHelperTest.php b/tests/image/Helper/ImageHelperTest.php index 46edb1bcd..5d3b55a94 100644 --- a/tests/image/Helper/ImageHelperTest.php +++ b/tests/image/Helper/ImageHelperTest.php @@ -56,6 +56,7 @@ public function testBase64Encode(): void { $url = "https://raw.githubusercontent.com/webeweb/core-library/master/tests/image/Fixtures/TestImage_1920x1037.jpg"; $exp = file_get_contents(__DIR__ . "/ImageHelperTest.testBase64Encode.txt"); + $this->assertEquals($exp, ImageHelper::base64Encode($uri)); $this->assertEquals($exp, ImageHelper::base64Encode($url)); diff --git a/tests/image/Model/ImageTest.php b/tests/image/Model/ImageTest.php index 445e69007..b9c58475b 100644 --- a/tests/image/Model/ImageTest.php +++ b/tests/image/Model/ImageTest.php @@ -53,6 +53,7 @@ public function testBase64Encode(): void { $obj = new Image($this->images[0]); $exp = file_get_contents(__DIR__ . "/../Helper/ImageHelperTest.testBase64Encode.txt"); + $this->assertEquals($exp, $obj->base64Encode()); } diff --git a/tests/maths/Helper/FibonacciHelperTest.php b/tests/maths/Helper/FibonacciHelperTest.php index 774fe2946..6b53f5c5c 100644 --- a/tests/maths/Helper/FibonacciHelperTest.php +++ b/tests/maths/Helper/FibonacciHelperTest.php @@ -70,6 +70,7 @@ public function testFibonacciWithNegative(): void { public function testSequence(): void { $exp = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]; + $this->assertEquals($exp, FibonacciHelper::sequence(10)); } @@ -81,6 +82,7 @@ public function testSequence(): void { public function testSequenceWithNegative(): void { $exp = [0, 1, -1, 2, -3, 5, -8, 13, -21, 34, -55]; + $this->assertEquals($exp, FibonacciHelper::sequence(-10)); } } diff --git a/tests/ocrlad/Provider/OcrProviderTest.php b/tests/ocrlad/Provider/OcrProviderTest.php index 662aff1f2..afc3a4dda 100644 --- a/tests/ocrlad/Provider/OcrProviderTest.php +++ b/tests/ocrlad/Provider/OcrProviderTest.php @@ -55,6 +55,7 @@ public function testBuildFilePaths(): void { "/localDirectoryAfter/~$md5.tif", ], ]; + $res = $obj->buildFilePaths($file); $this->assertEquals($exp, $res); } diff --git a/tests/skidata/Parser/CardParserTest.php b/tests/skidata/Parser/CardParserTest.php index 19819ea6a..c0c656ca3 100644 --- a/tests/skidata/Parser/CardParserTest.php +++ b/tests/skidata/Parser/CardParserTest.php @@ -65,6 +65,7 @@ public function testParseEntity(): void { $obj->setProductionFacilityNumber(1234567); $exp = '"ticketNumber";987654321;321;20170920;20170921;1;;2;0;3412;0;0;1;1;0;1;"displayText1";"displayText2";9876;123456789012;"serialNumberKeyCard";"3.0";3;"ticke";"serialNo";;20170922;1;1234567'; + $this->assertEquals($exp, (new CardParser())->parseEntity($obj)); } diff --git a/tests/skidata/Parser/CustomerParserTest.php b/tests/skidata/Parser/CustomerParserTest.php index 70c9faa86..e366d16e6 100644 --- a/tests/skidata/Parser/CustomerParserTest.php +++ b/tests/skidata/Parser/CustomerParserTest.php @@ -68,6 +68,7 @@ public function testParseEntity(): void { $obj->setAccountingNumber("accountingNumber"); $exp = '123456789;"title";"surname";"firstname";"street";"pCode";"city";"abc";"taxCode";"idDocumentNo";"telephone";"rentalAgreementNo";20170921;20170930;000000123456;1234;"remarks";20170921 103500;0;;0;1;1;0;1;"remarks2";"remarks3";"division";"email";0;"abc";"accountingNumber"'; + $this->assertEquals($exp, (new CustomerParser())->parseEntity($obj)); } diff --git a/tests/skidata/Parser/StartRecordFormatParserTest.php b/tests/skidata/Parser/StartRecordFormatParserTest.php index 441ef7888..2921e44b4 100644 --- a/tests/skidata/Parser/StartRecordFormatParserTest.php +++ b/tests/skidata/Parser/StartRecordFormatParserTest.php @@ -42,6 +42,7 @@ public function testParseEntity(): void { $obj->setCurrency("EUR"); $exp = '190000;0202747;20170921;00018;"EUR"'; + $this->assertEquals($exp, (new StartRecordFormatParser())->parseEntity($obj)); } diff --git a/tests/skidata/Parser/UserParserTest.php b/tests/skidata/Parser/UserParserTest.php index 6cce9d109..5738257e5 100644 --- a/tests/skidata/Parser/UserParserTest.php +++ b/tests/skidata/Parser/UserParserTest.php @@ -62,6 +62,7 @@ public function testParseEntity(): void { $obj->setETicketServiceArt(2); $exp = '987654321;123456789;"title";"surname";"firstname";20170920;"12345";"remarks";20170921 115500;0;"identificationNumber";0;1;1;"creditCardNumber";;"remarks2";"remarks3";"division";"email";1;1;"eTicketEmailTelephone";1;3;2'; + $this->assertEquals($exp, (new UserParser())->parseEntity($obj)); } diff --git a/tests/sorter/QuickSortTest.php b/tests/sorter/QuickSortTest.php index 762e5e179..46599178b 100644 --- a/tests/sorter/QuickSortTest.php +++ b/tests/sorter/QuickSortTest.php @@ -62,6 +62,7 @@ public function testSort(): void { $obj->sort(); $exp = [12, 21, 23, 32, 34, 43, 45, 54, 56, 65, 67, 76, 78, 87, 89, 98]; + $this->assertEquals($exp, $obj->getValues()); } diff --git a/tests/symfony/Helper/ColorHelperTest.php b/tests/symfony/Helper/ColorHelperTest.php index 87159dfe1..62e953076 100644 --- a/tests/symfony/Helper/ColorHelperTest.php +++ b/tests/symfony/Helper/ColorHelperTest.php @@ -34,6 +34,7 @@ public function testGetIdentifier(): void { $colorProvider = new RedColorProvider(); $exp = implode(":", ["MaterialDesignColorPalette", "red"]); + $this->assertEquals($exp, ColorHelper::getIdentifier($colorProvider)); } diff --git a/tests/symfony/Service/PhantomJSServiceTest.php b/tests/symfony/Service/PhantomJSServiceTest.php index 1a1dd965a..e323ef7cd 100644 --- a/tests/symfony/Service/PhantomJSServiceTest.php +++ b/tests/symfony/Service/PhantomJSServiceTest.php @@ -72,6 +72,7 @@ public function testGetCommand(): void { if ("\\" === DIRECTORY_SEPARATOR) { $exp .= ".exe"; } + $this->assertEquals($exp, $obj->getCommand()); } diff --git a/tests/validator/Status/DefaultStatusTest.php b/tests/validator/Status/DefaultStatusTest.php index c2571f464..2a469001e 100644 --- a/tests/validator/Status/DefaultStatusTest.php +++ b/tests/validator/Status/DefaultStatusTest.php @@ -35,6 +35,7 @@ public function testJsonSerialize(): void { $obj->setRuleName("ruleName"); $exp = ["code" => 200, "message" => "message", "ruleName" => "ruleName"]; + $this->assertEquals($exp, $obj->jsonSerialize()); }