瀏覽代碼

Added some tests

Wouter J 10 年之前
父節點
當前提交
86f4cfa5b4
共有 1 個文件被更改,包括 11 次插入0 次删除
  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