mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?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);
|
|
}
|
|
|
|
}
|
|
|