-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create tests for blocks being registered
- Loading branch information
Showing
24 changed files
with
767 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class AccordionTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'accordion'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var Kadence_Blocks_Accordion_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Accordion_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
public function testIsScriptRegistered() { | ||
$this->block->register_scripts(); | ||
|
||
$this->assertTrue( wp_script_is( 'kadence-blocks-accordion', 'registered' ), 'Block scripts registered' ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class AdvancedBtnTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'advancedbtn'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Advancedbtn_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Advancedbtn_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class AdvancedGalleryTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'advancedgallery'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Advancedbtn_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Advancedgallery_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
public function testIsScriptRegistered() { | ||
$this->block->register_scripts(); | ||
|
||
$this->assertTrue( wp_script_is( 'kad-splide', 'registered' ), 'Splide is registered' ); | ||
$this->assertTrue( wp_script_is( 'kadence-blocks-splide-init', 'registered' ), 'Splide init registered' ); | ||
$this->assertTrue( wp_script_is( 'kadence-blocks-masonry-init', 'registered' ), 'Masonry init registered' ); | ||
$this->assertTrue( wp_script_is( 'kadence-glightbox', 'registered' ), 'Glightbox registered' ); | ||
$this->assertTrue( wp_script_is( 'kadence-blocks-glight-init', 'registered' ), 'Glightbox init registered' ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class ColumnTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'column'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Column_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Column_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class CountdownTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'countdown'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Countdown_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Countdown_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
public function testIsScriptRegistered() { | ||
$this->block->register_scripts(); | ||
|
||
$this->assertTrue( wp_script_is( 'kadence-blocks-countdown', 'registered' ), 'Countdown script is registered' ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class CountupTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'countup'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Countup_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Countup_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
public function testIsScriptRegistered() { | ||
$this->block->register_scripts(); | ||
|
||
$this->assertTrue( wp_script_is( 'kadence-countup', 'registered' ), 'Count up library is registered' ); | ||
$this->assertTrue( wp_script_is( 'kadence-blocks-countup', 'registered' ), 'Count up script is registered' ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class FormTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'form'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Form_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Form_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class GooglemapsTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'icon'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Icon_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Icon_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class IconTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'googlemaps'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Googlemaps_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Googlemaps_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class IconListTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'iconlist'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Iconlist_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Iconlist_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\wpunit\blocks; | ||
class ImageTest extends \KadenceBlocksUnit { | ||
/** | ||
* @var \WpunitTester | ||
*/ | ||
protected $tester; | ||
|
||
/** | ||
* Block name. | ||
* | ||
* @var string | ||
*/ | ||
protected $block_name = 'image'; | ||
|
||
/** | ||
* Block instance. | ||
* | ||
* @var \Kadence_Blocks_Image_Block | ||
*/ | ||
protected $block; | ||
|
||
protected function _before() { | ||
$this->block = new \Kadence_Blocks_Image_Block(); | ||
} | ||
|
||
protected function _after() { | ||
} | ||
|
||
} |
Oops, something went wrong.