예제 #1
0
파일: UtilTest.php 프로젝트: ryprop/nife
 public function testEchoOutputFunction()
 {
     $collector = new Nife_Collector();
     $echoer = Nife_Util::getEchoFunction();
     $blob = new Nife_FooBarBazBlob();
     $this->assertTrue(Nife_Util::isEchoFunction($echoer));
     $this->assertFalse(Nife_Util::isEchoFunction($collector));
     $blob->writeTo($collector);
     $this->assertEquals("FooBarBaz", (string) $collector);
     ob_start();
     $blob->writeTo($echoer);
     $echoed = ob_get_contents();
     ob_end_clean();
     $this->assertEquals("FooBarBaz", $echoed);
 }
예제 #2
0
 public static function emit($thing, $indent = "", $indentDelta = "\t")
 {
     $emitter = new EarthIT_PAXML_PAXMLEmitter();
     $emitter->emit($thing, $indent, $indentDelta, Nife_Util::getEchoFunction());
 }
예제 #3
0
 public function testEchoOutputBlob()
 {
     ob_start();
     $this->blob->writeTo(Nife_Util::getEchoFunction());
     $this->assertEquals("Some stuff\n", ob_get_clean());
 }