protected function setUp()
 {
     parent::setUp();
     $this->dir = vfsStream::setup('root');
     $this->serializer = $this->getMockForAbstractClass(ParameterSerializerInterface::class);
     $this->reader = $this->getMockForAbstractClass(ParameterReaderInterface::class);
     $this->readerRegistry = $this->getMock(ReaderRegistry::class, array('getInstanceForFormat'));
     $this->readerRegistry->method('getInstanceForFormat')->willReturn($this->reader);
     $this->serializerRegistry = $this->getMock(SerializerRegistry::class, array('getInstanceForFormat'));
     $this->serializerRegistry->method('getInstanceForFormat')->willReturn($this->serializer);
     $this->task = new Parameters(vfsStream::url('root/' . self::PARAMETERS_FILE));
     $this->task->setSerializerRegistry($this->serializerRegistry)->setReaderRegistry($this->readerRegistry);
 }
Example #2
0
 /**
  * @return SerializerRegistry
  */
 public function getSerializerRegistry()
 {
     if (!$this->serializerRegistry) {
         $this->serializerRegistry = SerializerRegistry::getDefaultInstance();
     }
     return $this->serializerRegistry;
 }