Пример #1
0
 public function getIODescriptor()
 {
     if (self::$ioDescriptor == null) {
         $builder = new IODescriptorBuilder();
         self::$ioDescriptor = $builder->requires()->streamId('IN1')->type('string')->description('First string')->uses()->streamId('IN2')->type('string')->description('Second string that gets changed to IN1_IN2')->exports()->streamId('OUT')->type('string')->description('Output string: IN2_IN1_suffix')->get();
     }
     return self::$ioDescriptor;
 }
Пример #2
0
 public function getIODescriptor()
 {
     if (self::$ioDescriptor == null) {
         $builder = new IODescriptorBuilder();
         self::$ioDescriptor = $builder->requires()->streamId('in')->type('string')->description('Input string')->exports()->streamId('out')->type('string')->description('Output string')->get();
     }
     return self::$ioDescriptor;
 }
Пример #3
0
 public function testFilterIODescriptor()
 {
     $builder = new IODescriptorBuilder();
     $descriptorExpected = $builder->requires()->streamId('IN1')->type('string')->description('First string')->uses()->streamId('IN2')->type('string')->description('Second string that gets changed to IN1_IN2')->exports()->streamId('OUT')->type('string')->description('Output string: IN2_IN1_suffix')->get();
     $context = new SimpleFilterContext();
     $filter = new FixtureFilter($context, array("suffix" => "value"));
     $descriptorActual = $filter->getIODescriptor();
     $this->assertEquals($descriptorExpected, $descriptorActual);
 }
 /**
  * Descriptor must have an ID and at least one type. Description is optional
  *
  * @expectedException \InvalidArgumentException
  */
 public function testFailsWhenIDMissing()
 {
     $builder = new IODescriptorBuilder();
     $builder->requires()->type('type')->get();
 }