Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit bfc52a6

Browse files
committed
Fix tests not using setUp
Those tests won't be tested by child classes properly
1 parent 96dfb76 commit bfc52a6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

test/ArrayInputTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public function setUp()
2525
$this->input = new ArrayInput('foo');
2626
}
2727

28+
public function testNotEmptyValidatorNotInjectedIfContinueIfEmptyIsTrue($value = '')
29+
{
30+
parent::testNotEmptyValidatorNotInjectedIfContinueIfEmptyIsTrue([$value]);
31+
}
32+
2833
public function testValueIsNullByDefault()
2934
{
3035
$this->markTestSkipped('Test is not enabled in ArrayInputTest');

test/InputTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ public function testAllowEmptyFlagIsMutable()
9191

9292
public function testContinueIfEmptyFlagIsFalseByDefault()
9393
{
94-
$input = new Input('foo');
94+
$input = $this->input;
9595
$this->assertFalse($input->continueIfEmpty());
9696
}
9797

9898
public function testContinueIfEmptyFlagIsMutable()
9999
{
100-
$input = new Input('foo');
100+
$input = $this->input;
101101
$input->setContinueIfEmpty(true);
102102
$this->assertTrue($input->continueIfEmpty());
103103
}
@@ -194,11 +194,11 @@ public function testNotRequiredWithoutFallbackAndValueNotSetThenIsValid()
194194
$this->assertEquals([], $input->getMessages(), 'getMessages() should be empty because the input is valid');
195195
}
196196

197-
public function testNotEmptyValidatorNotInjectedIfContinueIfEmptyIsTrue()
197+
public function testNotEmptyValidatorNotInjectedIfContinueIfEmptyIsTrue($value = '')
198198
{
199-
$input = new Input('foo');
199+
$input = $this->input;
200200
$input->setContinueIfEmpty(true);
201-
$input->setValue('');
201+
$input->setValue($value);
202202
$input->isValid();
203203
$validators = $input->getValidatorChain()
204204
->getValidators();

0 commit comments

Comments
 (0)