Commit e3829955 authored by alexpott's avatar alexpott

Issue #2787657 by dawehner, alexpott:...

Issue #2787657 by dawehner, alexpott: \Drupal\Tests\rest\Unit\EntityResourceValidationTraitTest::testValidate
parent 3f8aa20c
......@@ -24,13 +24,12 @@ public function testValidate() {
$method = new \ReflectionMethod($trait, 'validate');
$method->setAccessible(TRUE);
$entity = $this->prophesize(Node::class);
$violations = $this->prophesize(EntityConstraintViolationList::class);
$violations->filterByFieldAccess()->willReturn([]);
$violations->count()->willReturn(0);
$violations->filterByFieldAccess()->shouldBeCalled()->willReturn([]);
$violations->count()->shouldBeCalled()->willReturn(0);
$entity->validate()->willReturn($violations->reveal());
$entity = $this->prophesize(Node::class);
$entity->validate()->shouldBeCalled()->willReturn($violations->reveal());
$method->invoke($trait, $entity->reveal());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment