woocommerce/tests/unit-tests/core/functions.php

28 lines
637 B
PHP
Raw Normal View History

2017-09-05 19:52:20 +00:00
<<?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 );
}
}