SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simpletest problem

    Hey guys!

    I got a question regarding simpletest. Thanks in advance to everybody who wants help me out.

    My team and I want to use Simpletest with Eclipse and thus I am the "scout" testing it all out. Installation went perfectly fine, the standard tests, too.

    Now I wanted to load it with the rest of the application meaning I require_once some of our files to get a database connection, etc. There are two slight problems though:

    1) We define constants LOG_MESSAGE, LOG_WARNING and LOG_NOTICE. Simpletest broke because it found duplicated constant declaration for those. Does SimpleTest declare those as well?

    2) When i manually fix problem 1 by changing our constants I get:

    {status:"fail",message:"Bad GroupTest [C:\\ll_development\\workspace\\linklift\\tests\\database\\updateHistory.test.php] with error [strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe\/Paris' for '2.0\/DST' instead]",group:"C:\\ll_development\\workspace\\linklift\\tests\\database\\updateHistory.test.php",case:"",method:""}

    ..in the eclipse console.

    How can I make simpletest ignore those and simply run the test?


    Here is the test:

    PHP Code:
    <?php
    define
    ('ROOT','C:\ll_development\workspace\company_name\html\php\\');
    require_once(
    ROOT.'LL_Constants.class.php');
    require_once(
    ROOT.'LL_Database.class.php');

    class 
    test1 extends UnitTestCase {
        protected 
    $db null;
        
          public function 
    __construct() {
              
    parent::__cosntruct();
              
    $this->db = new LL_Database;
          }
      
          public function 
    testForValidInput() {
              
    $this->assertEquals(ERROR_UNEXPECTED_INPUT,$this->db->updateAdspaceHistory(''));
              
    $this->assertEquals(ERROR_UNEXPECTED_INPUT,$this->db->updateAdspaceHistory('',array()));
               
    $this->assertEquals(ERROR_UNEXPECTED_INPUT,$this->db->updateAdspaceHistory('34525623',array()));
          }
    }
    ?>

  2. #2
    SitePoint Enthusiast GhostGambler's Avatar
    Join Date
    Apr 2007
    Location
    Germany, NRW
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @2 This is a php.ini setting, maybe check this one (or set it correctly via date_default_timezone_set)

  3. #3
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.

    using
    PHP Code:
    date_default_timezone_set('Europe/Berlin'); 
    won't fix the problem, though.

  4. #4
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anybody?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •