Skip to content

Commit 7986ca9

Browse files
committed
Updated to new phpunit. Added test for guess title
1 parent 83e76bd commit 7986ca9

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

tests/unit/MultipleInputTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,22 @@ public function testGuessColumn()
2828
$this->assertEquals($expected, $widget->columns);
2929
}
3030

31-
public function testGlobalErrorGuessColumn()
31+
public function testEnableGuessTitleInsideGuessColumn()
3232
{
3333
$model = new TestModel();
3434

3535
$widget = new MultipleInput([
3636
'model' => $model,
3737
'attribute' => 'email',
38-
'enableError' => true,
38+
'enableGuessTitle' => true,
3939
]);
4040

4141
$expected = [
42-
['name' => 'email', 'type' => MultipleInputColumn::TYPE_TEXT_INPUT, 'enableError' => true]
42+
[
43+
'name' => 'email',
44+
'type' => MultipleInputColumn::TYPE_TEXT_INPUT,
45+
'title' => 'Email',
46+
]
4347
];
4448

4549
$this->assertEquals($expected, $widget->columns);

tests/unit/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace unclead\multipleinput\tests\unit;
44

55

6-
abstract class TestCase extends \PHPUnit_Framework_TestCase
6+
abstract class TestCase extends \PHPUnit\Framework\TestCase
77
{
88

99
}

tests/unit/data/TestModel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,11 @@ public function rules()
2121
['email', 'safe']
2222
];
2323
}
24+
25+
public function attributeLabels()
26+
{
27+
return [
28+
'email' => 'Email',
29+
];
30+
}
2431
}

0 commit comments

Comments
 (0)