PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / trunk
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar vtrunk
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / vendor / wpdeveloper / lib-utility / test / php / basic-test.php

basic-test.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar trunk, at vendor/wpdeveloper/lib-utility/test/php/basic-test.php

59 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 * Class BasicUtilityTest
5 */
6 class BasicUtilityTest extends PHPUnit_Framework_TestCase {
7
8 /**
9 * Test Object Extending with Defaults
10 *
11 */
12 public function testDefaults() {
13
14 $myConfiguration = array(
15 "someOther" => 10
16 );
17
18 $defaultsSettings = array(
19 "someDefault" => 7
20 );
21
22 $finalConfiguration = UsabilityDynamics\Utility::defaults( $myConfiguration, $defaultsSettings );
23
24 $this->assertEquals( 7, $finalConfiguration->someDefault );
25 $this->assertEquals( 10, $finalConfiguration->someOther );
26
27 }
28
29 /**
30 * Test Utility::findUp();
31 *
32 */
33 public function testFindUp() {
34
35 // Traverse upward directory tree until fixtures/sample.json is found.
36 $sampleJSON = UsabilityDynamics\Utility::findUp( 'fixtures/sample.json' );
37
38 // Traverse upward directory tree until fixtures/sample.xml is found.
39 $sampleXML = UsabilityDynamics\Utility::findUp( 'fixtures/sample.xml' );
40
41 // Traverse upward directory tree until fixtures/sample.php is found.
42 UsabilityDynamics\Utility::findUp( 'fixtures/sample.php' );
43
44 // JSON Formatted properly.
45 $this->assertEquals( 1.1, $sampleJSON->anagrafica->{"@version"} );
46
47 // XML Formatted properly.
48 $this->assertEquals( 1.1, (string) $sampleXML->version );
49
50 // Custom class loaded.
51 $this->assertEquals( true, class_exists( 'MySampleClass' ) );
52
53 // Custom class method is accessible.
54 $this->assertEquals( true, method_exists( 'MySampleClass', 'test_method' ) );
55
56 }
57
58 }
59