Skip to content
Snippets Groups Projects
Select Git revision
  • 5e54f36b1166a5cc8f65ca69d435de90155ac683
  • master default protected
  • 1.1.0
  • 1.0
4 results

TestConstantNotDefinedStrategy.php

Blame
  • 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());
        }
    
    }