Skip to content

Commit 371b388

Browse files
committed
🚿
1 parent 979d2a0 commit 371b388

9 files changed

+30
-9
lines changed

tests/Common/CurlHandleTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class CurlHandleTest extends TestCase{
3434
protected ClientInterface $http;
3535

3636
// called from FactoryTrait
37-
protected function _setUp_():void{
37+
protected function setUp():void{
38+
$this->initFactories();
3839

3940
$options = new HTTPOptions([
4041
'ca_info' => __DIR__.'/../cacert.pem',

tests/Common/FactoryUtilsTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
class FactoryUtilsTest extends TestCase{
2727
use FactoryTrait;
2828

29+
protected function setUp():void{
30+
$this->initFactories();
31+
}
32+
2933
public function testCreateStream():void{
3034
$stream = FactoryUtils::createStream('test');
3135

tests/Common/MultipartStreamBuilderTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ class MultipartStreamBuilderTest extends TestCase{
2626

2727
protected MultipartStreamBuilder $multipartStreamBuilder;
2828

29-
protected function _setUp_():void{
29+
protected function setUp():void{
30+
$this->initFactories();
31+
3032
$this->multipartStreamBuilder = new MultipartStreamBuilder();
3133
}
3234

tests/FactoryTrait.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ trait FactoryTrait{
4545
/**
4646
* @throws \Exception
4747
*/
48-
protected function setUp():void{
48+
protected function initFactories():void{
4949

5050
foreach($this->FACTORIES as $property => $const){
5151

@@ -69,10 +69,6 @@ protected function setUp():void{
6969
$this->streamFactory
7070
);
7171

72-
if(method_exists($this, '_setUp_')){
73-
$this->_setUp_();
74-
}
75-
7672
}
7773

7874
}

tests/Psr15/PriorityQueueRequestHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
class PriorityQueueRequestHandlerTest extends TestCase{
2626
use FactoryTrait;
2727

28+
protected function setUp():void{
29+
$this->initFactories();
30+
}
31+
2832
public function testHandler():void{
2933

3034
$middlewareStack = [

tests/Psr15/QueueRequestHandlerTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
class QueueRequestHandlerTest extends TestCase{
2626
use FactoryTrait;
2727

28-
protected function getDispatcher():RequestHandlerInterface{
28+
protected function setUp():void{
29+
$this->initFactories();
30+
}
31+
32+
protected function getDispatcher():RequestHandlerInterface{
2933
// Create request handler instance:
3034
$dispatcher = new QueueDispatcher($this->getTestMiddlewareStack(), $this->getTestFallbackHandler());
3135

tests/Psr7/DummyStreamTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
class DummyStreamTest extends TestCase{
2525
use FactoryTrait;
2626

27+
protected function setUp():void{
28+
$this->initFactories();
29+
}
30+
2731
public function testDefaultStream():void{
2832
$dummy = new DummyStream;
2933

tests/Psr7/StreamTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
class StreamTest extends TestCase{
2828
use FactoryTrait;
2929

30+
protected function setUp():void{
31+
$this->initFactories();
32+
}
33+
3034
public function testConstructorThrowsExceptionOnInvalidArgument():void{
3135
$this->expectException(InvalidArgumentException::class);
3236

tests/Psr7/UploadedFileTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class UploadedFileTest extends TestCase{
3232
protected array $cleanup;
3333

3434
// called from FactoryTrait
35-
protected function _setUp_():void{
35+
protected function setUp():void{
36+
$this->initFactories();
37+
3638
$this->cleanup = [];
3739
}
3840

0 commit comments

Comments
 (0)