Commit d1616c37 authored by David Morley's avatar David Morley

add phpunit, add travis config

parent 5187a54c
language: php
php:
- 5.3
- 5.4
script: phpunit
<phpunit>
<testsuites>
<testsuite name="Poduptime">
<directory>phpunit</directory>
</testsuite>
</testsuites>
</phpunit>
<?php
class RemoteConnect
{
public function connectToServer($serverName=null)
{
if($serverName==null){
throw new Exception("That's not a server name!");
}
$fp = fsockopen($serverName,80);
return ($fp) ? true : false;
}
public function returnSampleObject()
{
return $this;
}
}
?>
<?php
require_once('RemoteConnect.php');
class RemoteConnectTest extends PHPUnit_Framework_TestCase
{
public function setUp(){ }
public function tearDown(){ }
public function testConnectionIsValid()
{
// test to ensure that the object from an fsockopen is valid
$connObj = new RemoteConnect();
$serverName = 'podupti.me';
$this->assertTrue($connObj->connectToServer($serverName) !== false);
}
}
?>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment