Add initial test file for WC_Register_Legacy_Settings, with test for constructor.

This commit is contained in:
Jeff Stieler 2016-06-13 10:09:31 -06:00 committed by Justin Shreve
parent 1cde743121
commit 3747505d83
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<?php
/**
* Settings API Tests
* @package WooCommerce\Tests\Settings
* @since 2.7.0
*/
class WC_Tests_Register_Legacy_Settings extends WC_Unit_Test_Case {
/**
* @var WC_Settings_Page $page
*/
protected $page;
/**
* Initialize a WC_Settings_Page for testing
*/
public function setUp() {
parent::setUp();
$this->page = new WC_Settings_General();
}
public function test_constructor() {
$legacy_settings = new WC_Register_Legacy_Settings( $this->page );
$this->assertEquals( has_filter( 'woocommerce_settings_groups', array( $legacy_settings, 'register_legacy_group' ) ), 10 );
$this->assertEquals( has_filter( 'woocommerce_settings-' . $this->page->get_id(), array( $legacy_settings, 'register_legacy_settings' ) ), 10 );
}
}