コード例 #1
0
ファイル: FixtureFilter.php プロジェクト: actinarium/philtre
 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
ファイル: FilterTest.php プロジェクト: actinarium/philtre
 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);
 }
コード例 #4
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testFailsWhenTypeMissing()
 {
     $builder = new IODescriptorBuilder();
     $builder->exports()->streamId('ID')->get();
 }