|
7 | 7 | use PHPUnit\Framework\MockObject\MockObject; |
8 | 8 | use PHPUnit\Framework\TestCase; |
9 | 9 | use Thenativeweb\Eventsourcingdb\Stream\CurlFactory; |
10 | | -use Thenativeweb\Eventsourcingdb\Stream\FileUpload; |
11 | 10 | use Thenativeweb\Eventsourcingdb\Stream\Queue; |
12 | 11 | use Thenativeweb\Eventsourcingdb\Stream\Request; |
13 | 12 | use Thenativeweb\Eventsourcingdb\Stream\Uri; |
@@ -122,38 +121,6 @@ public function testCreateSetsPostFieldsIfBodyExists(): void |
122 | 121 | $this->assertSame($body, $options[CURLOPT_POSTFIELDS]); |
123 | 122 | } |
124 | 123 |
|
125 | | - public function testCreateSetsReadFunctionIfBodyFileUpload(): void |
126 | | - { |
127 | | - $fileUpload = $this->createMock(FileUpload::class); |
128 | | - $fileUpload->method('getSize')->willReturn(123); |
129 | | - $fileUpload->method('read')->willReturn('chunk'); |
130 | | - |
131 | | - $this->uriMock->method('__toString')->willReturn('https://example.com/upload'); |
132 | | - $this->uriMock->method('getScheme')->willReturn('https'); |
133 | | - |
134 | | - $this->requestMock->method('getMethod')->willReturn('POST'); |
135 | | - $this->requestMock->method('getProtocolVersion')->willReturn('1.1'); |
136 | | - $this->requestMock->method('getHeaders')->willReturn([]); |
137 | | - $this->requestMock->method('getUri')->willReturn($this->uriMock); |
138 | | - $this->requestMock->method('getBody')->willReturn($fileUpload); |
139 | | - $this->requestMock->method('hasHeader')->willReturn(false); |
140 | | - |
141 | | - $options = CurlFactory::create( |
142 | | - $this->requestMock, |
143 | | - $this->headerQueueMock, |
144 | | - $this->writeQueueMock, |
145 | | - ); |
146 | | - |
147 | | - $this->assertArrayHasKey(CURLOPT_INFILESIZE, $options); |
148 | | - $this->assertArrayHasKey(CURLOPT_READFUNCTION, $options); |
149 | | - $this->assertArrayHasKey(CURLOPT_RETURNTRANSFER, $options); |
150 | | - $this->assertArrayHasKey(CURLOPT_UPLOAD, $options); |
151 | | - $this->assertSame(123, $options[CURLOPT_INFILESIZE]); |
152 | | - $this->assertIsCallable($options[CURLOPT_READFUNCTION]); |
153 | | - $this->assertTrue($options[CURLOPT_RETURNTRANSFER]); |
154 | | - $this->assertTrue($options[CURLOPT_UPLOAD]); |
155 | | - } |
156 | | - |
157 | 124 | public function testCreateSetsNoBodyForHeadMethod(): void |
158 | 125 | { |
159 | 126 | $this->requestMock->method('getMethod')->willReturnCallback(static fn (): string => 'HEAD'); |
|
0 commit comments