Kaynağa Gözat

Added test for GH-564

Menno Holtkamp 10 yıl önce
ebeveyn
işleme
63631b66e2
1 değiştirilmiş dosya ile 27 ekleme ve 0 silme
  1. 27 0
      tests/Zend/Application/ApplicationTest.php

+ 27 - 0
tests/Zend/Application/ApplicationTest.php

@@ -108,6 +108,33 @@ class Zend_Application_ApplicationTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($options, $application->getOptions());
     }
 
+    /**
+     * @group GH-564
+     * @depends testConstructorInstantiatesAutoloader
+     */
+    public function testConstructorRespectsSuppressFileNotFoundWarningFlag()
+    {
+        $application = new Zend_Application('testing');
+        $this->assertFalse($application->getAutoloader()->suppressNotFoundWarnings()); //Default value
+
+        $application = new Zend_Application('testing', null, $suppressNotFoundWarnings = true);
+        $this->assertTrue($application->getAutoloader()->suppressNotFoundWarnings());
+
+        $application = new Zend_Application('testing', null, $suppressNotFoundWarnings = false);
+        $this->assertFalse($application->getAutoloader()->suppressNotFoundWarnings());
+
+        $options = array(
+            'foo' => 'bar',
+            'bar' => 'baz',
+        );
+
+        $application = new Zend_Application('testing', $options, $suppressNotFoundWarnings = true);
+        $this->assertTrue($application->getAutoloader()->suppressNotFoundWarnings());
+
+        $application = new Zend_Application('testing', $options, $suppressNotFoundWarnings = false);
+        $this->assertFalse($application->getAutoloader()->suppressNotFoundWarnings());
+    }
+
     public function testHasOptionShouldReturnFalseWhenOptionNotPresent()
     {
         $this->assertFalse($this->application->hasOption('foo'));