mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
V 3.5 RC 1
This commit is contained in:
55
lib/unitTest/system/system_serverTest.php
Normal file
55
lib/unitTest/system/system_serverTest.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../PhraseanetPHPUnitAbstract.class.inc';
|
||||
|
||||
/**
|
||||
* Test class for system_server.
|
||||
* Generated by PHPUnit on 2011-02-15 at 15:11:49.
|
||||
*/
|
||||
class system_serverTest extends PhraseanetPHPUnitAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* @var system_server
|
||||
*/
|
||||
protected $objects = array();
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$_SERVER['SERVER_SOFTWARE'] = 'apache';
|
||||
$this->objects['apache'] = new system_server;
|
||||
$_SERVER['SERVER_SOFTWARE'] = 'nginx';
|
||||
$this->objects['nginx'] = new system_server;
|
||||
$_SERVER['SERVER_SOFTWARE'] = 'lighttpd';
|
||||
$this->objects['lighttpd'] = new system_server;
|
||||
}
|
||||
|
||||
public function testIs_nginx()
|
||||
{
|
||||
$this->assertFalse($this->objects['apache']->is_nginx());
|
||||
$this->assertTrue($this->objects['nginx']->is_nginx());
|
||||
$this->assertFalse($this->objects['lighttpd']->is_nginx());
|
||||
}
|
||||
|
||||
public function testIs_lighttpd()
|
||||
{
|
||||
$this->assertFalse($this->objects['apache']->is_lighttpd());
|
||||
$this->assertFalse($this->objects['nginx']->is_lighttpd());
|
||||
$this->assertTrue($this->objects['lighttpd']->is_lighttpd());
|
||||
}
|
||||
|
||||
public function testIs_apache()
|
||||
{
|
||||
$this->assertTrue($this->objects['apache']->is_apache());
|
||||
$this->assertFalse($this->objects['nginx']->is_apache());
|
||||
$this->assertFalse($this->objects['lighttpd']->is_apache());
|
||||
}
|
||||
|
||||
public function testGet_platform()
|
||||
{
|
||||
$platform = system_server::get_platform();
|
||||
$this->assertRegExp('/[A-Z]+/', $platform);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user