Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[ZF-10769] Zend_Log (revision 23467)
Browse files Browse the repository at this point in the history
- Fixed the assignment of  the option "facility".
  • Loading branch information
b-durand committed Mar 10, 2011
1 parent e1a1562 commit e9e8913
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/Log/Writer/Syslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
17 changes: 17 additions & 0 deletions tests/Zend/Log/Writer/SyslogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.