Neos\ContentRepository\Eel\FlowQueryOperations\CacheLifetimeOperation::canEvaluate PHP Method

canEvaluate() public method

public canEvaluate ( $context ) : boolean
return boolean TRUE if the operation can be applied onto the $context, FALSE otherwise
    public function canEvaluate($context)
    {
        return count($context) === 0 || isset($context[0]) && $context[0] instanceof NodeInterface;
    }

Usage Example

 /**
  * @test
  */
 public function canEvaluateReturnsTrueIfNodeIsInContext()
 {
     $mockNode = $this->createMock(NodeInterface::class);
     $result = $this->operation->canEvaluate(array($mockNode));
     $this->assertTrue($result);
 }
CacheLifetimeOperation