Plugin Directory

Changeset 347546


Ignore:
Timestamp:
02/19/2011 01:17:04 AM (15 years ago)
Author:
rgeyer
Message:

refactor test dir, attempting to add wordpress-tests to externals

Location:
twitter-api-shortcodes/trunk
Files:
4 added
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • twitter-api-shortcodes/trunk/tasforwp.class.inc.php

    r347518 r347546  
    1313  public static function StaticInit($wpdb)
    1414  {
    15     TasForWp::$_wpdb = $wpdb;
    16     TasForWp::$StatusByIdTableName = TasForWp::$_wpdb->prefix . 'tas_status_by_id';
    17     TasForWp::$StatusSearchTableName = TasForWp::$_wpdb->prefix . 'tas_status_search';
    18     TasForWp::$SearchTableName = TasForWp::$_wpdb->prefix . 'tas_search';
     15    TasForWp::$_wpdb                  = $wpdb;
     16    TasForWp::$StatusByIdTableName    = TasForWp::$_wpdb->prefix . 'tas_status_by_id';
     17    TasForWp::$StatusSearchTableName  = TasForWp::$_wpdb->prefix . 'tas_status_search';
     18    TasForWp::$SearchTableName        = TasForWp::$_wpdb->prefix . 'tas_search';
    1919  }
    2020
  • twitter-api-shortcodes/trunk/tests/integration/tasforwpTest.php

    r347518 r347546  
    11<?php
    2 
     2require_once('common.inc');
    33require_once('functions.php');
    4 
    5 function register_activation_hook($path, $callbackName) {}
    6 function register_deactivation_hook($path, $callbackName) {}
    7 
    8 require_once('MockPress/mockpress.php');
    94require_once('tasforwp.class.inc.php');
    10 
    11 require_once('PHPUnit/Framework.php');
     5require_once('PHPUnit/Autoload.php');
    126
    137class TasForWPTests extends PHPUnit_Framework_TestCase {
    148    public function testTasInstall() {
    15         $wpdb = $this->getMock('wpdb', array('get_var'));
    16 
    17         $wpdb->expects($this->once())
    18             ->method('get_var');
    19         TasForWp::StaticInit($wpdb);
    20         TasForWp::tas_install();
     9      TasForWp::tas_install();
     10      assert(json_decode(get_option('tas_db_info'))->db_version == TAS_DB_VERSION);
    2111    }
    2212}
Note: See TracChangeset for help on using the changeset viewer.