MCPcopy Create free account
hub / github.com/apache/thrift / testWrite

Method testWrite

lib/php/test/Unit/Lib/Transport/TSocketTest.php:514–536  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

512 }
513
514 public function testWrite()
515 {
516 $host = 'localhost';
517 $port = 9090;
518 $persist = false;
519 $debugHandler = null;
520 $transport = new TSocket(
521 $host,
522 $port,
523 $persist,
524 $debugHandler
525 );
526 $fileName = sys_get_temp_dir() . '/' . md5(mt_rand(0, time()) . time());
527 touch($fileName);
528 $handle = fopen($fileName, 'r+');
529 $transport->setHandle($handle);
530 $transport->write('test1234456789132456798');
531 $this->assertEquals('test1234456789132456798', file_get_contents($fileName));
532
533 register_shutdown_function(function () use ($fileName) {
534 is_file($fileName) && unlink($fileName);
535 });
536 }
537
538 public function writeFailDataProvider()
539 {

Callers

nothing calls this directly

Calls 2

writeMethod · 0.65
setHandleMethod · 0.45

Tested by

no test coverage detected