Esempio n. 1
0
 public function testFilterOperationInWiringContext()
 {
     $context = new WiringFilterContext();
     $context->setData('IN1', 'testing');
     $context->setData('IN2', 'Testing');
     $stream1Before = $context->getStream('IN1');
     $stream2Before = $context->getStream('IN2');
     $filter = new FixtureFilter($context, array("suffix" => "123"));
     $filter->process();
     $this->assertEquals('testing', $context->getData('IN1'));
     $this->assertEquals('testing', $context->getStream('IN1')->getData());
     $this->assertEquals('Testing_testing', $context->getData('IN2'));
     $this->assertEquals('Testing_testing', $context->getStream('IN2')->getData());
     $this->assertEquals('testing_Testing_123', $context->getData('OUT'));
     $this->assertEquals('testing_Testing_123', $context->getStream('OUT')->getData());
     $this->assertSame($stream1Before, $context->getStream('IN1'));
     $this->assertSame($stream2Before, $context->getStream('IN2'));
     // even though data changed, the stream is same
 }
Esempio n. 2
0
 public function testWiringContextReturnsEmptyStreamWhenUnregistered()
 {
     $context = new WiringFilterContext();
     $this->assertNull($context->getData(TEST));
     $this->assertNotNull($context->getStream("TEST2"));
     $this->assertNull($context->getStream("TEST3")->getData());
 }