/** * Test Utility::findUp(); * */ public function testFindUp() { // Traverse upward directory tree until fixtures/sample.json is found. $sampleJSON = UsabilityDynamics\Utility::findUp('fixtures/sample.json'); // Traverse upward directory tree until fixtures/sample.xml is found. $sampleXML = UsabilityDynamics\Utility::findUp('fixtures/sample.xml'); // Traverse upward directory tree until fixtures/sample.php is found. UsabilityDynamics\Utility::findUp('fixtures/sample.php'); // JSON Formatted properly. $this->assertEquals(1.1, $sampleJSON->anagrafica->{"@version"}); // XML Formatted properly. $this->assertEquals(1.1, (string) $sampleXML->version); // Custom class loaded. $this->assertEquals(true, class_exists('MySampleClass')); // Custom class method is accessible. $this->assertEquals(true, method_exists('MySampleClass', 'test_method')); }
/** * Wrapper for the UD_API::log() function that includes the prefix automatically. * * @author peshkov@UD * * @param bool $message * @param string $type * @param bool $object * @param array $args * * @return boolean */ public static function log($message = false, $type = 'default', $object = false, $args = array()) { $args = wp_parse_args((array) $args, array('type' => $type, 'object' => $object, 'instance' => 'WP-Property')); return parent::log($message, $args); }