public function canEvaluateChecksForContentContext() { $operation = new ParentsOperation(); $mockNode = $this->createMock(NodeInterface::class); $mockContext = $this->getMockBuilder(ContentContext::class)->disableOriginalConstructor()->getMock(); $mockNode->expects($this->any())->method('getContext')->will($this->returnValue($mockContext)); $context = array($mockNode); $this->assertTrue($operation->canEvaluate($context), 'Must accept ContentContext'); $mockNode = $this->createMock(NodeInterface::class); $mockContext = $this->getMockBuilder(Context::class)->disableOriginalConstructor()->getMock(); $mockNode->expects($this->any())->method('getContext')->will($this->returnValue($mockContext)); $context = array($mockNode); $this->assertFalse($operation->canEvaluate($context), 'Must not accept Context'); }