コード例 #1
0
 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));
 }
コード例 #2
0
 /**
  * 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;
         }
     }
 }