コード例 #1
0
 /**
  * @covers BWP_Framework_Util::is_debugging
  * @dataProvider get_test_is_debugging_cases
  */
 public function test_is_debugging($wp_debug_constant, $expected)
 {
     if (isset($wp_debug_constant)) {
         define('WP_DEBUG', $wp_debug_constant);
     }
     $this->assertEquals($expected, BWP_Framework_Util::is_debugging());
 }
コード例 #2
0
 /**
  * Get dependencies based on environment
  *
  * @param array $deps current dependencies of the item being checked
  * @param string $prod_handle the handle used in production environment
  *
  * @return array
  */
 protected function get_deps_by_environment(array $deps, $prod_handle = null)
 {
     if ($prod_handle && !BWP_Framework_Util::is_debugging()) {
         // due to a bug in the enqueueing system, we need to merge
         // dependencies for combined assets for the prod_handle because
         // any dependencies attached to other handles that have the same
         // prod_handle will not be taken into account when their sources
         // are set to false
         //
         // @link https://core.trac.wordpress.org/ticket/25247
         $this->combined_assets[$prod_handle] = array_merge($deps, $this->combined_assets[$prod_handle]);
         return $this->combined_assets[$prod_handle];
     }
     return $deps;
 }