Select Git revision
Has_Plugin_Info.php
TestConstantNotDefinedStrategy.php 680 B
<?php
namespace unit;
use WPDesk\ShowDecision\ConstantNotDefinedStrategy;
class TestConstantNotDefinedStrategy extends \WP_Mock\Tools\TestCase
{
public function testShouldNotDisplayWhenConstantIsDefined()
{
// Given
define('TEST3_CONSTANT', 'test');
$strategy = new ConstantNotDefinedStrategy('TEST_CONSTANT');
// When & Then
$this->assertFalse($strategy->shouldDisplay());
}
public function testShouldDisplayWhenConstantIsNotDefined()
{
// Given
$strategy = new ConstantNotDefinedStrategy('TEST4_CONSTANT');
// When & Then
$this->assertTrue($strategy->shouldDisplay());
}
}