Update test_get_woocommerce_currencies to test for both cached and uncached currencies, gives us more code coverage

This commit is contained in:
Gerhard Potgieter 2018-07-11 14:25:42 +02:00
parent 7fa802071e
commit eb533d0263
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,7 @@ class WC_Tests_Core_Functions extends WC_Unit_Test_Case {
* @since 2.2
*/
public function test_get_woocommerce_currencies() {
static $currencies;
$expected_currencies = array(
'AED' => 'United Arab Emirates dirham',
@ -194,6 +195,10 @@ class WC_Tests_Core_Functions extends WC_Unit_Test_Case {
);
$this->assertEquals( $expected_currencies, get_woocommerce_currencies() );
// Unset cached currencies and test again.
unset( $currencies );
$this->assertEquals( $expected_currencies, get_woocommerce_currencies() );
}
/**