Inheritance: extends PHPUnit_Framework_TestCase
 public function addTestCase(UnitTestCase $testCase)
 {
     if ($testCase instanceof GroupTest) {
         $this->_testCases = array_merge($this->_testCases, $testCase->getTestCases());
     } else {
         $this->_testCases[get_class($testCase)] = $testCase;
     }
 }
 /**
  *    Uses reflection to run every method within itself
  *    starting with the string "test" unless a method
  *    is specified.
  *    @param SimpleReporter $reporter    Current test reporter.
  *    @return boolean                    True if all tests passed.
  *    @access public
  */
 function run(&$reporter)
 {
     $this->setUpFixture();
     $ret = parent::run($reporter);
     $this->tearDownFixture();
     return $ret;
 }
 /**
  * The constructor method.
  */
 function __construct()
 {
     $oServiceLocator =& OA_ServiceLocator::instance();
     $oNow = new Date('2008-04-01 12:30:00');
     $oServiceLocator->register('now', $oNow);
     parent::__construct();
 }
 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     Mock::generate('OA_Dal_Maintenance_Priority', $this->mockDal = 'MockOA_Dal_Maintenance_Priority' . rand());
     Mock::generatePartial('OA_Maintenance_Priority_AdServer_Task_PriorityCompensation', 'PartialMock_OA_Maintenance_Priority_AdServer_Task_PriorityCompensation', array('_getDal', '_getOperationIntUtils', '_getMaxEntityAdObject'));
     Mock::generatePartial('OA_Maintenance_Priority_Ad', 'PartialOA_Maintenance_Priority_Ad', array());
 }
 function __construct()
 {
     parent::__construct();
     $username = '******';
     $password = '******';
     $login_url = 'http://cctm:8888/wp-login.php';
     $this->ckfile = tempnam('/tmp', 'CURLCOOKIE');
     $post_data = array();
     $post_data['log'] = $username;
     $post_data['pwd'] = $password;
     foreach ($post_data as $key => $value) {
         $post_items[] = $key . '=' . $value;
     }
     $post_string = implode('&', $post_items);
     $ch = curl_init($login_url);
     curl_setopt($ch, CURLOPT_COOKIEJAR, $this->ckfile);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
     curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
     $result = curl_exec($ch);
     curl_close($ch);
 }
 /**
  * The class constructor method.
  */
 function __construct()
 {
     parent::__construct();
     Mock::generate('MAX_Dal_Entities');
     Mock::generate('OA_Dal_Maintenance_Priority');
     Mock::generatePartial('OX_Maintenance_Priority_Campaign', 'MockPartialOX_Maintenance_Priority_Campaign', array('_abort'));
 }
 function setUp()
 {
     // @todo mock the tokenizer
     $this->proc = new Elgg_Ecml_Processor(new Elgg_Ecml_Tokenizer());
     elgg_register_plugin_hook_handler('view', 'output/text', 'ecml_process_view');
     parent::setUp();
 }
Esempio n. 8
0
 function test_AkActiveRecord_actAsTree()
 {
     parent::UnitTestCase();
     $this->_createNewTestingModelDatabase('AkTestCategory');
     $this->_createNewTestingModel('AkTestCategory');
     $this->_createNewTestingModel('AkDependentTestCategory');
 }
Esempio n. 9
0
 function setUp()
 {
     parent::setUp();
     $this->factory = TestHelper::getPartialMock('Tracker_CrossSearch_SharedFieldFactory', array('getDao'));
     $this->dao = new MockTracker_CrossSearch_SharedFieldDao();
     $this->factory->setReturnValue('getDao', $this->dao);
 }
 public function tearDown()
 {
     parent::tearDown();
     unset($GLOBALS['sys_force_ssl']);
     unset($GLOBALS['sys_default_domain']);
     unset($GLOBALS['sys_https_host']);
 }
 function tearDown()
 {
     if (file_exists($this->cache_file)) {
         unlink($this->cache_file);
     }
     parent::tearDown();
 }
  function &_createRunner(&$reporter)
  {
    if ($this->_isDebugging())
      return new SimpleRunner($this, $reporter);

    return parent::_createRunner($reporter);
  }
 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     $this->oDbh = OA_DB::singleton();
     $this->oCache = new OA_DB_XmlCache();
     $this->oSchema =& MDB2_Schema::factory($this->oDbh, array('force_defaults' => false));
 }
 public function __construct()
 {
     $this->environ = new MongoTestEnvironment();
     $this->environ->clean();
     $this->save = array();
     parent::__construct();
 }
Esempio n. 15
0
 function __construct()
 {
     parent::__construct();
     $c = new Naf_UnitTestDbConnection();
     $this->connection = $c->getConnection();
     Naf_Table::setDefaultConnection($this->connection);
 }
Esempio n. 16
0
 function __construct()
 {
     parent::__construct('Kademlia HTTP Test');
     return;
     #############################
     $this->node = KademliaTestFactory::constructNode(['protocols' => [Kademlia\Http::protocol_id => ['protocol' => 'http', 'host' => '10.0.0.1', 'port' => 8080, 'path' => '/kad/kademlia']]]);
 }
Esempio n. 17
0
 function __construct()
 {
     parent::__construct('Kademlia Bucket Test');
     $settings = new Kademlia\Settings();
     $settings->own_node_id = Kademlia\Node::randomNodeId();
     $this->settings = $settings;
 }
 function setUp()
 {
     $this->_clean_up();
     parent::setUp();
     debug_mock::init($this);
     $this->object =& new phpbb_user();
 }
Esempio n. 19
0
 public function __construct($path)
 {
     $this->_path = $path;
     $this->_parser = new HTMLPurifier_StringHashParser();
     $this->_builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
     parent::__construct($path);
 }
 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     Mock::generate('OA_Dal_Maintenance_Priority', $this->mockDal = 'MockOA_Dal_Maintenance_Priority' . rand());
     Mock::generate('MAX_Dal_Admin_Data_intermediate_ad', $this->mockDalIntermediateAd = 'MAX_Dal_Admin_Data_intermediate_ad' . rand());
     Mock::generatePartial('OA_Maintenance_Priority_AdServer_Task_ECPMforRemnant', 'PartialMock_OA_Maintenance_Priority_AdServer_Task_ECPMforRemnant', array('_getDal', '_factoryDal', 'getTodaysRemainingOperationIntervals', 'calculateCampaignEcpm'));
 }
 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     Mock::generate('MAX_Dal_Entities');
     Mock::generate('OA_Dal_Maintenance_Priority');
     Mock::generate('OA_DB_Table_Priority');
 }
 function tearDown()
 {
     parent::tearDown();
     foreach (array_keys($this->node_object_mocks) as $id) {
         $this->node_object_mocks[$id]->tally();
     }
 }
 function setUp()
 {
     parent::setUp();
     $config = new lmbSet(array('default_profile' => 'foo_profile', 'foo_profile' => array('type' => 'fckeditor', 'baz' => 42), 'bar_profile' => array('type' => 'tinymce', 'baz' => 111)));
     lmbToolkit::instance()->setConf('wysiwyg', $config);
     $this->_helper = new lmbWysiwygConfigurationHelper();
 }
 function __construct()
 {
     parent::__construct();
     // pseudo-default value
     // php quirks - static class members are not reset after each test.
     Config::setIdSeparator('---');
 }
Esempio n. 25
0
 public function tearDown()
 {
     $this->clear_tables();
     Session::instance()->destroy();
     Session::instance()->create();
     parent::tearDown();
 }
 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     // Prepare the MSE DAL for use in the tests
     $oFactory = new OX_Dal_Maintenance_Statistics_Factory();
     $this->oDal = $oFactory->factory();
 }
Esempio n. 27
0
 public function setUp(DiInterface $di = NULL, Config $config = NULL)
 {
     vfsStream::setup('root');
     vfsStream::newFile('file.php')->at(vfsStreamWrapper::getRoot());
     $this->file = vfsStream::url('root/file.php');
     parent::setUp($di, $config);
 }
 function __construct()
 {
     parent::__construct();
     $this->dir = 'tmp/' . md5(uniqid(rand(), true)) . '/';
     mkdir($this->dir);
     $this->oldDir = getcwd();
 }
Esempio n. 29
0
 function __construct()
 {
     require_once '../PelIfd.php';
     require_once '../PelTag.php';
     require_once '../PelEntryAscii.php';
     parent::__construct('PEL IFD Tests');
 }
Esempio n. 30
0
 function TestUpload()
 {
     parent::UnitTestCase();
     $this->CI =& get_instance();
     $this->DBI = $this->CI->load->database('testing', TRUE);
     $this->setUpDB();
 }