|
4 | 4 |
|
5 | 5 | namespace Wrkflow\GetValueTests; |
6 | 6 |
|
7 | | -use Illuminate\Foundation\Http\FormRequest; |
8 | | -use Illuminate\Http\Request; |
9 | 7 | use PHPUnit\Framework\TestCase; |
10 | 8 | use SimpleXMLElement; |
11 | 9 | use Wrkflow\GetValue\GetValue; |
12 | 10 | use Wrkflow\GetValue\GetValueFactory; |
13 | 11 | use Wrkflow\GetValue\Strategies\NoTransformerStrategy; |
14 | 12 | use Wrkflow\GetValueTests\Builders\CustomExceptionBuilder; |
15 | | -use Wrkflow\GetValueTests\Mocks\ValidatorMock; |
16 | 13 |
|
17 | 14 | class GetValueFactoryTest extends TestCase |
18 | 15 | { |
@@ -57,63 +54,6 @@ public function testArray(): void |
57 | 54 | $getValue->getRequiredString('no_value'); |
58 | 55 | } |
59 | 56 |
|
60 | | - public function testRequestAll(): void |
61 | | - { |
62 | | - if (class_exists(Request::class) === false) { |
63 | | - $this->markTestSkipped('Laravel not installed.'); |
64 | | - } |
65 | | - |
66 | | - $getValue = $this->factory->requestAll(new Request([ |
67 | | - 'test' => 'This is a test', |
68 | | - 'not_validated' => 'Test', |
69 | | - ])); |
70 | | - |
71 | | - $this->assertEquals('This is a test', $getValue->getRequiredString('test')); |
72 | | - $this->assertEquals('Test', $getValue->getString('not_validated')); |
73 | | - } |
74 | | - |
75 | | - public function testRequestValidated(): void |
76 | | - { |
77 | | - if (class_exists(Request::class) === false) { |
78 | | - $this->markTestSkipped('Laravel not installed.'); |
79 | | - } |
80 | | - |
81 | | - $getValue = $this->factory->request($this->getFormRequest()); |
82 | | - |
83 | | - $this->assertEquals('This is a test', $getValue->getRequiredString('test')); |
84 | | - $this->assertNull($getValue->getString('not_validated')); |
85 | | - } |
86 | | - |
87 | | - public function testRequestAllWithFormRequest(): void |
88 | | - { |
89 | | - if (class_exists(Request::class) === false) { |
90 | | - $this->markTestSkipped('Laravel not installed.'); |
91 | | - } |
92 | | - |
93 | | - $request = $this->getFormRequest(); |
94 | | - $getValue = $this->factory->requestAll($request); |
95 | | - |
96 | | - $this->assertEquals('This is a test', $getValue->getRequiredString('test')); |
97 | | - $this->assertEquals('Test', $getValue->getString('not_validated')); |
98 | | - } |
99 | | - |
100 | | - protected function getFormRequest(): FormRequest |
101 | | - { |
102 | | - $request = new FormRequest([ |
103 | | - 'test' => 'This is a test', |
104 | | - 'not_validated' => 'Test', |
105 | | - ]); |
106 | | - $validator = new ValidatorMock([ |
107 | | - 'test' => 'This is a test', |
108 | | - ]); |
109 | | - FormRequest::macro('validate', fn () => $validator->validate()); |
110 | | - $request->setValidator($validator); |
111 | | - $request->validate([ |
112 | | - 'test' => 'string', |
113 | | - ]); |
114 | | - return $request; |
115 | | - } |
116 | | - |
117 | 57 | protected function createArray(): GetValue |
118 | 58 | { |
119 | 59 | return $this->factory->array([ |
|
0 commit comments