Skip to content

Commit

Permalink
added test for plugin path and url
Browse files Browse the repository at this point in the history
  • Loading branch information
Fellan-91 committed Feb 6, 2024
1 parent 6d939a2 commit 3a3f16f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tests/phpunit/unit/test-ghostkit-class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* Tests for Ghostkit Main Class
*
* @package ghostkit
*/

/**
* Ghostkit test case.
*/
class GhostkitTest extends WP_UnitTestCase {
/**
* Set up our mocked WP functions. Rather than setting up a database we can mock the returns of core WordPress functions.
*
* @return void
*/
public function set_up() {
parent::set_up();
}

/**
* Tear down WP Mock.
*
* @return void
*/
public function tear_down() {
parent::tear_down();
}

/**
* Plugin Path test.
*/
public function test_plugin_path() {
$defined_path = '/var/www/html/wp-content/plugins/ghostkit/';
$plugin_path = ghostkit()->plugin_path;

$this->assertEquals( $defined_path, $plugin_path );
}

/**
* Plugin Url test.
*/
public function test_plugin_url() {
$defined_url = 'http://localhost:8889/wp-content/plugins/var/www/html/wp-content/plugins/ghostkit/';
$plugin_url = ghostkit()->plugin_url;

$this->assertEquals( $defined_url, $plugin_url );
}
}

0 comments on commit 3a3f16f

Please sign in to comment.