@@ -108,9 +100,7 @@ HTML
public function testWidgetOptions()
{
- ob_start();
- $this->getListView(['options' => ['class' => 'test-passed'], 'separator' => ''])->run();
- $out = ob_get_clean();
+ $out = $this->getListView(['options' => ['class' => 'test-passed'], 'separator' => ''])->run();
$this->assertEqualsWithoutLE(<<<'HTML'
Showing 1-3 of 3 items.
@@ -133,7 +123,7 @@ HTML
],
[
function ($model, $key, $index, $widget) {
- return "Item #{$index}: {$model['login']} - Widget: " . $widget->class;
+ return "Item #{$index}: {$model['login']} - Widget: " . get_class($widget);
},
'
Showing 1-3 of 3 items.
Item #0: silverfire - Widget: yii\widgets\ListView
@@ -159,9 +149,7 @@ HTML
*/
public function testItemViewOptions($itemView, $expected)
{
- ob_start();
- $this->getListView(['itemView' => $itemView])->run();
- $out = ob_get_clean();
+ $out = $this->getListView(['itemView' => $itemView])->run();
$this->assertEqualsWithoutLE($expected, $out);
}
@@ -205,9 +193,7 @@ HTML
*/
public function testItemOptions($itemOptions, $expected)
{
- ob_start();
- $this->getListView(['itemOptions' => $itemOptions])->run();
- $out = ob_get_clean();
+ $out = $this->getListView(['itemOptions' => $itemOptions])->run();
$this->assertEqualsWithoutLE($expected, $out);
}
@@ -226,12 +212,10 @@ HTML
return "";
};
- ob_start();
- $this->getListView([
+ $out = $this->getListView([
'beforeItem' => $before,
'afterItem' => $after,
])->run();
- $out = ob_get_clean();
$this->assertEqualsWithoutLE(<<
Showing 1-3 of 3 items.