Browse Source

Added some tests

Wouter J 10 years ago
parent
commit
86f4cfa5b4
1 changed files with 11 additions and 0 deletions
  1. 11 0
      Tests/Mapper/BaseGroupedMapperTest.php

+ 11 - 0
Tests/Mapper/BaseGroupedMapperTest.php

@@ -132,6 +132,17 @@ class BaseGroupedMapperTest extends \PHPUnit_Framework_TestCase
         $this->baseGroupedMapper->tab('fooTab');
         $this->baseGroupedMapper->tab('barTab');
     }
+    
+    public function testHasOpenTab()
+    {
+        $this->assertFalse($this->baseGroupedMapper->hasOpenTab(), '->hasOpenTab() returns false when there are no tabs');
+        
+        $this->baseGroupedMapper->tab('fooTab');
+        $this->assertTrue($this->baseGroupedMapper->hasOpenTab(), '->hasOpenTab() returns true when there is an open tab');
+        
+        $this->baseGroupedMapper->end();
+        $this->assertFalse($this->baseGroupedMapper->hasOpenTab(), '->hasOpenTab() returns false when all tabs are closed')
+    }
 
     /**
      * @expectedException        RuntimeException