From 2ff3617bdaa20963bc5e9f244562934357172546 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 28 Jul 2014 01:59:51 +0200 Subject: [PATCH] #6183 - minor code cleanups - avoiding redundant vars --- .../Log/Processor/ReferenceIdTest.php | 52 ++++++++----------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/tests/ZendTest/Log/Processor/ReferenceIdTest.php b/tests/ZendTest/Log/Processor/ReferenceIdTest.php index 34bf48f1f76..1ffba941cc6 100644 --- a/tests/ZendTest/Log/Processor/ReferenceIdTest.php +++ b/tests/ZendTest/Log/Processor/ReferenceIdTest.php @@ -18,16 +18,13 @@ class ReferenceIdTest extends \PHPUnit_Framework_TestCase { public function testProcessMixesInReferenceId() { - $processor = new ReferenceId(); - - $event = array( - 'timestamp' => '', - 'priority' => 1, + $processor = new ReferenceId(); + $processedEvent = $processor->process(array( + 'timestamp' => '', + 'priority' => 1, 'priorityName' => 'ALERT', - 'message' => 'foo', - ); - - $processedEvent = $processor->process($event); + 'message' => 'foo', + )); $this->assertArrayHasKey('extra', $processedEvent); $this->assertInternalType('array', $processedEvent['extra']); @@ -38,21 +35,17 @@ public function testProcessMixesInReferenceId() public function testProcessDoesNotOverwriteReferenceId() { - $processor = new ReferenceId(); - - $referenceId = 'bar'; - - $event = array( - 'timestamp' => '', - 'priority' => 1, + $processor = new ReferenceId(); + $referenceId = 'bar'; + $processedEvent = $processor->process(array( + 'timestamp' => '', + 'priority' => 1, 'priorityName' => 'ALERT', - 'message' => 'foo', - 'extra' => array( + 'message' => 'foo', + 'extra' => array( 'referenceId' => $referenceId, ), - ); - - $processedEvent = $processor->process($event); + )); $this->assertArrayHasKey('extra', $processedEvent); $this->assertInternalType('array', $processedEvent['extra']); @@ -63,8 +56,7 @@ public function testProcessDoesNotOverwriteReferenceId() public function testCanSetAndGetReferenceId() { - $processor = new ReferenceId(); - + $processor = new ReferenceId(); $referenceId = 'foo'; $processor->setReferenceId($referenceId); @@ -75,18 +67,16 @@ public function testCanSetAndGetReferenceId() public function testProcessUsesSetReferenceId() { $referenceId = 'foo'; + $processor = new ReferenceId(); - $processor = new ReferenceId(); $processor->setReferenceId($referenceId); - $event = array( - 'timestamp' => '', - 'priority' => 1, + $processedEvent = $processor->process(array( + 'timestamp' => '', + 'priority' => 1, 'priorityName' => 'ALERT', - 'message' => 'foo', - ); - - $processedEvent = $processor->process($event); + 'message' => 'foo', + )); $this->assertArrayHasKey('extra', $processedEvent); $this->assertInternalType('array', $processedEvent['extra']);