Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit cea55b3

Browse files
committed
Change the path to the trait Testing_Helper
Since the unit tests are moved to tests/php/unit, change the path of this helper.
1 parent 7f978dd commit cea55b3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function _manually_load_plugin() {
2727
$plugin_root = dirname( __DIR__ );
2828
require $plugin_root . '/vendor/autoload.php';
2929
require $plugin_root . '/vendor/antecedent/patchwork/Patchwork.php';
30-
require $plugin_root . '/tests/php/trait-testing-helper.php';
30+
require $plugin_root . '/tests/php/unit/helpers/trait-testing-helper.php';
3131
require $plugin_root . '/block-lab.php';
3232
}
3333
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );

tests/php/unit/test-class-util.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ public function test_is_pro() {
6868
$this->assertFalse( block_lab()->is_pro() );
6969
}
7070

71+
/**
72+
* Test loop.
73+
*
74+
* @covers \Block_Lab\Util::loop()
75+
*/
76+
public function test_loop() {
77+
$this->assertEquals( 'Block_Lab\\Blocks\Loop', get_class( $this->instance->loop() ) );
78+
79+
// Calling this singleton function repeatedly should return the same instance of the Loop.
80+
$this->assertEquals( $this->instance->loop(), $this->instance->loop() );
81+
}
82+
7183
/**
7284
* Test get_template_locations.
7385
*

0 commit comments

Comments
 (0)