/**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     wl_configure_wordpress_test();
     wl_empty_blog();
     rl_empty_dataset();
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     $this->log_service = Wordlift_Log_Service::get_logger('EntityServiceTest');
     wl_configure_wordpress_test();
     wl_empty_blog();
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Empty the blog.
     wl_empty_blog();
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Empty the blog.
     wl_empty_blog();
     add_theme_support('post-thumbnails');
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Empty the blog.
     wl_empty_blog();
     // Empty the local cache.
     system('rm -rf ' . wl_caching_get_cache_folder());
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Reset data on the remote dataset.
     rl_empty_dataset();
     // Empty the blog.
     wl_empty_blog();
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Empty the blog.
     wl_empty_blog();
     // Check that entities and posts have been deleted.
     $this->assertEquals(0, count(get_posts(array('posts_per_page' => -1, 'post_type' => 'post', 'post_status' => 'any'))));
     $this->assertEquals(0, count(get_posts(array('posts_per_page' => -1, 'post_type' => 'entity', 'post_status' => 'any'))));
 }
 /**
  * Set up the test fixture.
  * Override wp_die(), pretend to be ajax, and suppres E_WARNINGs
  */
 public function setUp()
 {
     parent::setUp();
     // Suppress warnings from "Cannot modify header information - headers already sent by"
     $this->_error_level = error_reporting();
     error_reporting($this->_error_level & ~E_WARNING);
     wl_configure_wordpress_test();
     add_filter('wp_die_ajax_handler', array($this, 'getDieHandler'), 1, 1);
     if (!defined('DOING_AJAX')) {
         define('DOING_AJAX', true);
     }
     // Disable the *wl_write_log* as it can create issues with AJAX tests.
     add_filter('wl_write_log_handler', array($this, 'get_write_log_handler'), 1, 1);
     wl_empty_blog();
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     wl_configure_wordpress_test();
     wl_empty_blog();
     $this->assertEquals(0, count(get_posts(array('posts_per_page' => -1, 'post_type' => 'post', 'post_status' => 'any'))));
     $this->assertEquals(0, count(get_posts(array('posts_per_page' => -1, 'post_type' => 'entity', 'post_status' => 'any'))));
     // Empty the remote dataset.
     rl_empty_dataset();
     // Get the count of triples.
     $counts = rl_count_triples();
     $this->assertNotNull($counts);
     $this->assertFalse(is_wp_error($counts));
     //		$this->assertEquals( 0, $counts['subjects'] );
     //		$this->assertEquals( 0, $counts['predicates'] );
     //		$this->assertEquals( 0, $counts['objects'] );
 }
Exemple #10
0
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Reset data on the remote dataset.
     rl_empty_dataset();
     // Check that the dataset is empty.
     //        $this->assertEquals( array(
     //            'subjects'   => 0,
     //            'predicates' => 0,
     //            'objects'    => 0
     //        ), rl_count_triples() );
     // Empty the blog.
     wl_empty_blog();
     // Check that entities and posts have been deleted.
     $this->assertEquals(0, count(get_posts(array('posts_per_page' => -1, 'post_type' => array('post', 'page', 'entity'), 'post_status' => 'any'))));
 }
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Empty the blog.
     wl_empty_blog();
     // Creating 2 fake entities
     $entities = array(wl_create_post('content', 'entity1', 'title1', 'publish', 'entity'), wl_create_post('content', 'entity2', 'title2', 'publish', 'entity'));
     // Creating a fake post
     self::$FIRST_POST_ID = wl_create_post('content', 'post1', 'title1', 'publish', 'post');
     wl_core_add_relation_instances(self::$FIRST_POST_ID, WL_WHAT_RELATION, $entities);
     // Creating another fake post and entity (the most connected one)
     // Creating a fake post
     $new_post = wl_create_post('content', 'post2', 'title2', 'publish', 'post');
     // Create the most connected entity
     self::$MOST_CONNECTED_ENTITY_ID = wl_create_post('content', 'entity2', 'title2', 'publish', 'entity');
     wl_core_add_relation_instance($new_post, WL_WHAT_RELATION, self::$MOST_CONNECTED_ENTITY_ID);
     wl_core_add_relation_instance(self::$FIRST_POST_ID, WL_WHAT_RELATION, self::$MOST_CONNECTED_ENTITY_ID);
 }