public function testError_handler() { $config = new FtpConfiguration(); $fs = new Ftp($config); $fs->getErrorHandler()->handler(0, 'Error', '1', '2'); $this->assertInternalType('array', $fs->getErrorHandler()->getAll(false)); $this->assertEquals(1, $fs->getErrorHandler()->count(true)); }
public function testIsAlive() { // Configure the stub. $stub = $this->getMock('Zikula\\Component\\FileSystem\\Facade\\FtpFacade'); $stub->expects($this->any())->method('systype')->will($this->returnValue(true)); $this->ftp->setDriver($stub); $this->assertEquals(true, $this->ftp->isAlive()); // Configure the stub. $stub = $this->getMock('Zikula\\Component\\FileSystem\\Facade\\FtpFacade'); $stub->expects($this->any())->method('systype')->will($this->returnValue(false)); $this->ftp->setDriver($stub); $this->assertEquals(false, $this->ftp->isAlive()); }