Permalink
Browse files

[ZF-10769] Zend_Log (revision 23467)

- Fixed the assignment of  the option "facility".
  • Loading branch information...
1 parent e1a1562 commit e9e89139c0dd9975653d459ea731a2514a637755 @b-durand b-durand committed Jan 13, 2011
Showing with 18 additions and 1 deletion.
  1. +1 −1 library/Zend/Log/Writer/Syslog.php
  2. +17 −0 tests/Zend/Log/Writer/SyslogTest.php
View
2 library/Zend/Log/Writer/Syslog.php
@@ -105,7 +105,7 @@ public function __construct(array $params = array())
$runInitializeSyslog = true;
if (isset($params['facility'])) {
- $this->_facility = $this->setFacility($params['facility']);
+ $this->setFacility($params['facility']);
$runInitializeSyslog = false;
}
View
17 tests/Zend/Log/Writer/SyslogTest.php
@@ -85,4 +85,21 @@ public function testFluentInterface()
$this->assertTrue($instance instanceof SyslogWriter);
}
+
+ /**
+ * @group ZF-10769
+ */
+ public function testPastFacilityViaConstructor()
+ {
+ $writer = new SyslogWriterCustom(array('facility' => LOG_USER));
+ $this->assertEquals(LOG_USER, $writer->getFacility());
+ }
+}
+
+class SyslogWriterCustom extends SyslogWriter
+{
+ public function getFacility()
+ {
+ return $this->_facility;
+ }
}

0 comments on commit e9e8913

Please sign in to comment.