Ejemplo n.º 1
0
 /**
  * @see \Drupal\page_manager\Plugin\VariantAwareInterface::getVariants()
  */
 public function getVariants()
 {
     if (!$this->variantCollection) {
         $this->variantCollection = new VariantCollection(\Drupal::service('plugin.manager.display_variant'), $this->getVariantConfig());
         $this->variantCollection->sort();
     }
     return $this->variantCollection;
 }
Ejemplo n.º 2
0
 /**
  * @covers ::getVariants
  *
  * @depends testGetVariants
  */
 public function testGetVariantsSort(VariantCollection $variants)
 {
     $this->assertSame(['bar' => 'bar', 'foo' => 'foo'], $variants->getInstanceIds());
 }