diff --git a/CHANGELOG.md b/CHANGELOG.md index c6ee2c9..5dbd195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +### Added +- WooCommerce events + ### Fixed - headers error from new line in Server Timing diff --git a/src/Event/WooCommerce_Events.php b/src/Event/WooCommerce_Events.php new file mode 100644 index 0000000..8f31d37 --- /dev/null +++ b/src/Event/WooCommerce_Events.php @@ -0,0 +1,24 @@ + new Core_Events(), - 'genesis' => new Genesis_Events(), - 'hybrid' => new Hybrid_Events(), - 'tha' => new THA_Events(), - 'yoast' => new Yoast_Events(), + 'core' => new Core_Events(), + 'genesis' => new Genesis_Events(), + 'hybrid' => new Hybrid_Events(), + 'tha' => new THA_Events(), + 'woocommerce' => new WooCommerce_Events(), + 'yoast' => new Yoast_Events(), ]; }; } diff --git a/tests/Event/EventTest.php b/tests/Event/EventTest.php index f9bbbaa..809d476 100644 --- a/tests/Event/EventTest.php +++ b/tests/Event/EventTest.php @@ -7,6 +7,7 @@ use Rarst\Laps\Event\Core_Events; use Rarst\Laps\Event\Genesis_Events; use Rarst\Laps\Event\Hybrid_Events; use Rarst\Laps\Event\THA_Events; +use Rarst\Laps\Event\WooCommerce_Events; use Rarst\Laps\Event\Yoast_Events; use Rarst\Laps\Tests\LapsTestCase; @@ -62,6 +63,19 @@ class EventTest extends LapsTestCase { $this->assertNotEmpty( $events ); } + public function testWooCommerce() { + + $woocommerce = new WooCommerce_Events(); + $this->assertEmpty( $woocommerce->get_events() ); + + $this->getMockBuilder( 'WooCommerce' )->allowMockingUnknownTypes()->getMock(); + + $events = $woocommerce->get_events(); + + $this->assertInternalType( 'array', $events ); + $this->assertNotEmpty( $events ); + } + public function testYoast() { $yoast = new Yoast_Events();