Location: PHPKode > projects > TeamSpeak3-Library > devMX-TeamSpeak3-Library-e93460b/test/src/devmx/Teamspeak3/FileTransfer/DownloaderTest.php
<?php

namespace devmx\Teamspeak3\FileTransfer;
use devmx\Transmission\TransmissionStub;
 
/**
 * Test class for Downloader.
 * Generated by PHPUnit on 2012-01-23 at 12:14:42.
 */
class DownloaderTest extends \PHPUnit_Framework_TestCase
{

    

    /**
     * Test whole transfer process
     */
    public function testTransfer()
    {
       $transmission = new TransmissionStub('foo', 30033);
       $toRead = "this is a file\n with newlines in it \n".  str_repeat( 'asdf', 5124);
       $downloader = new Downloader($transmission, 'foobar', strlen($toRead));
       $this->assertEquals('', $transmission->getReceived());
       $this->assertEquals('', $transmission->getSentData());
       $this->assertFalse($transmission->isEstablished());
       $transmission->setToReceive($toRead);
       $file = $downloader->transfer();
       $this->assertEquals($toRead, $file);
       $this->assertEquals('foobar', $transmission->getSentData());
    }

}

?>
Return current item: TeamSpeak3-Library