public function testIsSupportedEntity() { $correctEntity = new \stdClass(); $nonCorrectEntity = new \stdClass(); $this->chainProvider->expects($this->any())->method('isSupportedEntity')->will($this->returnCallback(function ($input) use($correctEntity) { return $input === $correctEntity; })); $this->assertTrue($this->manager->isSupportedEntity($correctEntity)); $this->assertFalse($this->manager->isSupportedEntity($nonCorrectEntity)); }
/** * Collect inserted activities * * @param array $entities */ protected function collectInsertedEntities(array $entities) { foreach ($entities as $hash => $entity) { if (empty($this->insertedEntities[$hash]) && $this->activityListManager->isSupportedEntity($entity)) { $this->insertedEntities[$hash] = $entity; } } }