diff --git a/composer.json b/composer.json index 56174f6e..c79aeee8 100644 --- a/composer.json +++ b/composer.json @@ -73,12 +73,12 @@ "extra": { "downloads": { "pact-ffi-headers": { - "version": "0.4.8", + "version": "0.4.9", "url": "https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v{$version}/pact.h", "path": "bin/pact-ffi-headers/pact.h" }, "pact-ffi-lib": { - "version": "0.4.8", + "version": "0.4.9", "variables": { "{$prefix}": "PHP_OS_FAMILY === 'Windows' ? 'pact_ffi' : 'libpact_ffi'", "{$os}": "PHP_OS === 'Darwin' ? 'osx' : strtolower(PHP_OS_FAMILY)", diff --git a/example/binary/pacts/binaryConsumer-binaryProvider.json b/example/binary/pacts/binaryConsumer-binaryProvider.json index 7ecf427f..c6a957a1 100644 --- a/example/binary/pacts/binaryConsumer-binaryProvider.json +++ b/example/binary/pacts/binaryConsumer-binaryProvider.json @@ -42,9 +42,9 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.7", - "mockserver": "1.2.3", - "models": "1.1.9" + "ffi": "0.4.9", + "mockserver": "1.2.4", + "models": "1.1.11" }, "pactSpecification": { "version": "3.0.0" diff --git a/example/json/pacts/jsonConsumer-jsonProvider.json b/example/json/pacts/jsonConsumer-jsonProvider.json index 709eefa4..a169f1f2 100644 --- a/example/json/pacts/jsonConsumer-jsonProvider.json +++ b/example/json/pacts/jsonConsumer-jsonProvider.json @@ -63,9 +63,9 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.7", - "mockserver": "1.2.3", - "models": "1.1.9" + "ffi": "0.4.9", + "mockserver": "1.2.4", + "models": "1.1.11" }, "pactSpecification": { "version": "3.0.0" diff --git a/example/message/pacts/messageConsumer-messageProvider.json b/example/message/pacts/messageConsumer-messageProvider.json index 95669646..9b9cd512 100644 --- a/example/message/pacts/messageConsumer-messageProvider.json +++ b/example/message/pacts/messageConsumer-messageProvider.json @@ -41,8 +41,8 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.7", - "models": "1.1.9" + "ffi": "0.4.9", + "models": "1.1.11" }, "pactSpecification": { "version": "3.0.0" diff --git a/example/multipart/consumer/src/Service/HttpClientService.php b/example/multipart/consumer/src/Service/HttpClientService.php index f9a79f66..8a1ee65f 100644 --- a/example/multipart/consumer/src/Service/HttpClientService.php +++ b/example/multipart/consumer/src/Service/HttpClientService.php @@ -27,9 +27,6 @@ public function updateUserProfile(): string 'name' => 'full_name', 'contents' => 'Zoey Turcotte', 'filename' => 'full_name.txt', - 'headers' => [ - 'Content-Type' => 'application/octet-stream', - ], ], [ 'name' => 'profile_image', @@ -40,10 +37,6 @@ public function updateUserProfile(): string 'name' => 'personal_note', 'contents' => 'testing', 'filename' => 'note.txt', - 'headers' => [ - 'X-Foo' => 'this is a note', - 'Content-Type' => 'application/octet-stream', - ], ], ], 'headers' => [ diff --git a/example/multipart/consumer/tests/Service/HttpClientServiceTest.php b/example/multipart/consumer/tests/Service/HttpClientServiceTest.php index 0df7999d..6fff0d46 100644 --- a/example/multipart/consumer/tests/Service/HttpClientServiceTest.php +++ b/example/multipart/consumer/tests/Service/HttpClientServiceTest.php @@ -34,9 +34,9 @@ public function testUpdateUserProfile() ], ]) ->setBody(new Multipart([ - new Part($fullNameTempFile = $this->createTempFile($fullName), 'full_name', 'text/plain'), + new Part(__DIR__ . '/../_resource/full_name.txt', 'full_name', 'text/plain'), new Part(__DIR__ . '/../_resource/image.jpg', 'profile_image', in_array(php_uname('m'), ['AMD64', 'arm64']) ? 'application/octet-stream' : 'image/jpeg'), - new Part($personalNoteTempFile = $this->createTempFile($personalNote), 'personal_note', 'text/plain'), + new Part(__DIR__ . '/../_resource/note.txt', 'personal_note', 'text/plain'), ])); $response = new ProviderResponse(); @@ -68,9 +68,6 @@ public function testUpdateUserProfile() $userProfileResponse = $service->updateUserProfile(); $verifyResult = $builder->verify(); - unlink($fullNameTempFile); - unlink($personalNoteTempFile); - $this->assertTrue($verifyResult); $this->assertEquals([ 'full_name' => $fullName, @@ -78,18 +75,4 @@ public function testUpdateUserProfile() 'personal_note' => $personalNote, ], \json_decode($userProfileResponse, true, 512, JSON_THROW_ON_ERROR)); } - - private function createTempFile(string $contents): string - { - $path = tempnam(sys_get_temp_dir(), 'pact'); - //$newPath = "$path.txt"; - //rename($path, $newPath); - $newPath = $path; - - $handle = fopen($newPath, 'w'); - fwrite($handle, $contents); - fclose($handle); - - return $newPath; - } } diff --git a/example/multipart/consumer/tests/_resource/full_name.txt b/example/multipart/consumer/tests/_resource/full_name.txt new file mode 100644 index 00000000..de749767 --- /dev/null +++ b/example/multipart/consumer/tests/_resource/full_name.txt @@ -0,0 +1 @@ +Colten Ziemann \ No newline at end of file diff --git a/example/multipart/consumer/tests/_resource/note.txt b/example/multipart/consumer/tests/_resource/note.txt new file mode 100644 index 00000000..9a2c7732 --- /dev/null +++ b/example/multipart/consumer/tests/_resource/note.txt @@ -0,0 +1 @@ +testing \ No newline at end of file diff --git a/example/multipart/pacts/multipartConsumer-multipartProvider.json b/example/multipart/pacts/multipartConsumer-multipartProvider.json index eb2fcc33..4f517af1 100644 --- a/example/multipart/pacts/multipartConsumer-multipartProvider.json +++ b/example/multipart/pacts/multipartConsumer-multipartProvider.json @@ -115,7 +115,7 @@ ], "metadata": { "pactRust": { - "ffi": "0.4.8", + "ffi": "0.4.9", "mockserver": "1.2.4", "models": "1.1.11" },