28 lines
637 B
PHP
28 lines
637 B
PHP
|
<<?php
|
||
|
|
||
|
/**
|
||
|
* Class Functions.
|
||
|
*
|
||
|
* @package WooCommerce\Tests\Core
|
||
|
* @since 3.2.0
|
||
|
*/
|
||
|
class WC_Tests_WooCommerce_Functions extends WC_Unit_Test_Case {
|
||
|
|
||
|
/**
|
||
|
* Tests wc_maybe_define_constant().
|
||
|
*
|
||
|
* @since 3.2.0
|
||
|
*/
|
||
|
public function test_wc_maybe_define_constant() {
|
||
|
$this->assertFalse( defined( 'WC_TESTING_DEFINE_FUNCTION' ) );
|
||
|
|
||
|
// Check if defined.
|
||
|
wc_maybe_define_constant( 'WC_TESTING_DEFINE_FUNCTION', true );
|
||
|
$this->assertTrue( defined( 'WC_TESTING_DEFINE_FUNCTION' ) );
|
||
|
|
||
|
// Check value.
|
||
|
wc_maybe_define_constant( 'WC_TESTING_DEFINE_FUNCTION', false );
|
||
|
$this->assertTrue( WC_TESTING_DEFINE_FUNCTION );
|
||
|
}
|
||
|
}
|