Esempio n. 1
0
 /**
  * Test create slicer.
  */
 public function testCreateSlicer()
 {
     $slicer = Factory::create();
     $this->assertNotNull($slicer);
     $this->assertInstanceOf(Config::class, $slicer->getConfig());
 }
Esempio n. 2
0
 /**
  * Returns the current Slicer instance.
  *
  * @param bool|TRUE $required
  *
  * @return Slicer
  */
 public function getSlicer($required = TRUE)
 {
     if (NULL === $this->slicer) {
         try {
             $this->slicer = Factory::create();
         } catch (InvalidArgumentException $e) {
             if ($required && NULL !== $this->output) {
                 $this->output->writeln($e->getMessage());
                 exit(1);
             }
         }
     }
     return $this->slicer;
 }