Unittests
[ class tree: Unittests ] [ index: Unittests ] [ all elements ]

Source for file EnviromentTest.php

Documentation is available at EnviromentTest.php

  1. <?php
  2. /**
  3.  * Console Library
  4.  *
  5.  * LICENSE
  6.  *
  7.  * "THE BEER-WARE LICENSE" (Revision 42):
  8.  * "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
  9.  * As long as you retain this notice you can do whatever you want with
  10.  * this stuff. If we meet some day, and you think this stuff is worth it,
  11.  * you can buy me a beer in return.
  12.  *
  13.  * $Author$
  14.  * $Revisio$
  15.  *
  16.  * @category    Console
  17.  * @package     Unittests
  18.  * @copyright   Copyright (c) 2009 Sven Strittmatter
  19.  */
  20.  
  21. // Call Console_ApplicationTest::main() if this source file is executed directly.
  22. if (!defined('PHPUnit_MAIN_METHOD')) {
  23.     define('PHPUnit_MAIN_METHOD''Console_EnviromentTest::main');
  24. }
  25.  
  26. /**
  27.  * Test helper
  28.  */
  29. require_once(dirname(__FILE__'/../TestHelper.php');
  30.  
  31. /**
  32.  * Console_Loader
  33.  */
  34. require_once('Console/Enviroment.php');
  35.  
  36. /**
  37.  * @category   Console
  38.  * @package    Unittests
  39.  * @copyright  Copyright (c) 2009 Sven Strittmatter
  40.  */
  41. class Console_EnviromentTest extends PHPUnit_Framework_TestCase {
  42.     /**
  43.      * Runs the test methods of this class.
  44.      *
  45.      * @return void 
  46.      */
  47.     public static function main({
  48.         require_once('PHPUnit/TextUI/TestRunner.php');
  49.         $suite  new PHPUnit_Framework_TestSuite("Console_EnviromentTest");
  50.         $result PHPUnit_TextUI_TestRunner::run($suite);
  51.     }
  52.  
  53.     public function testIsSapiCli({
  54.         /**
  55.          * we asume cli cause tests run on console.
  56.          * @todo test try running on non CLI
  57.          */
  58.         $this->assertTrue(Console_Enviroment::isSapiCli());
  59.     }
  60.  
  61.     public function testIsOs({
  62.         
  63.         switch (TESTS_CONSOLE_ENVIROMENT_TESTRUNNEROS{
  64.             case 'MacOs':
  65.                 $this->assertTrue(Console_Enviroment::isMacOs());
  66.                 break;
  67.             case 'Debian':
  68.             case 'Suse':
  69.             case 'RedHat':
  70.                 $this->markTestIncomplete('Untested os: ' PHP_OS);
  71.                 break;
  72.             case 'Windws':
  73.                 $this->markTestIncomplete('Untested os: ' PHP_OS);
  74.                 break;
  75.             default:
  76.                 $this->markTestIncomplete('Untested os: ' PHP_OS);
  77.                 break;
  78.         }
  79.         
  80.     }
  81. }

Documentation generated on Mon, 17 Aug 2009 15:52:33 +0200 by phpDocumentor 1.4.2