mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MNT Fix unit tests
This commit is contained in:
parent
47337782a2
commit
5b2820e8ac
@ -377,7 +377,7 @@ class SSViewer_DataPresenter extends SSViewer_Scope
|
|||||||
// Check if the method to-be-called exists on the target object - if so, don't check any further
|
// Check if the method to-be-called exists on the target object - if so, don't check any further
|
||||||
// injection locations
|
// injection locations
|
||||||
$on = $this->itemIterator ? $this->itemIterator->current() : $this->item;
|
$on = $this->itemIterator ? $this->itemIterator->current() : $this->item;
|
||||||
if (isset($on->$property) || method_exists($on, $property ?? '')) {
|
if ($on !== null && (isset($on->$property) || method_exists($on, $property ?? ''))) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ namespace SilverStripe\View\Tests;
|
|||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
use LogicException;
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use Silverstripe\Assets\Dev\TestAssetStore;
|
use Silverstripe\Assets\Dev\TestAssetStore;
|
||||||
use SilverStripe\Control\ContentNegotiator;
|
use SilverStripe\Control\ContentNegotiator;
|
||||||
@ -1557,12 +1558,10 @@ after'
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @expectedException \LogicException
|
|
||||||
* @expectedExceptionMessage Up called when we're already at the top of the scope
|
|
||||||
*/
|
|
||||||
public function testTooManyUps()
|
public function testTooManyUps()
|
||||||
{
|
{
|
||||||
|
$this->expectException(LogicException::class);
|
||||||
|
$this->expectExceptionMessage("Up called when we're already at the top of the scope");
|
||||||
$data = new ArrayData([
|
$data = new ArrayData([
|
||||||
'Foo' => new ArrayData([
|
'Foo' => new ArrayData([
|
||||||
'Name' => 'Foo',
|
'Name' => 'Foo',
|
||||||
|
Loading…
Reference in New Issue
Block a user