PHP Classes

File: tests/FtpAdapterTest.php

Recommend this page to a friend!
  Classes of Johnny Mast   Redbox PHP Scandir Filter   tests/FtpAdapterTest.php   Download  
File: tests/FtpAdapterTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Redbox PHP Scandir Filter
Scan files for new or modified files
Author: By
Last change: Last minute changes
Date: 8 years ago
Size: 1,038 bytes
 

Contents

Class file image Download
<?php
namespace Redbox\Scan\Tests;
use
Redbox\Scan\Exception;
use
Redbox\Scan\Adapter;
use
Redbox\Scan;

/**
 * This class will run tests against the default Ftp adapter. Please not that this
 * tests will be skipped on travis. You can only run these tests on your local machine.
 *
 * @coversDefaultClass \Redbox\Scan\Adapter\Ftp
 * @package Redbox\Scan\Tests
 * @group ExcludeFromHHVM
 */
class FtpAdapterTest extends \PHPUnit_Framework_TestCase
{

   
/**
     * Test that ftp.kernel.org allows anonymous login's
     */
   
public function test_ftp_authenticate_returns_true()
    {
       
$anonymous_ftp_adapter = new Adapter\Ftp (
           
'ftp.kernel.org',
           
'anonymous',
           
'anonymous',
           
''
       
);

       
$ret = $anonymous_ftp_adapter->authenticate();
       
$this->assertTrue($ret);

        if (
$ret === true)
        {
           
$this->assertTrue($anonymous_ftp_adapter->setPassiveMode(true));
           
$this->assertTrue($anonymous_ftp_adapter->setActiveMode());
        }
    }
}