Skip to content

Commit

Permalink
zendframework#6183 - minor code cleanups - avoiding redundant vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius authored and dima committed Nov 27, 2014
1 parent ae75f39 commit 2ff3617
Showing 1 changed file with 21 additions and 31 deletions.
52 changes: 21 additions & 31 deletions tests/ZendTest/Log/Processor/ReferenceIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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']);
Expand All @@ -63,8 +56,7 @@ public function testProcessDoesNotOverwriteReferenceId()

public function testCanSetAndGetReferenceId()
{
$processor = new ReferenceId();

$processor = new ReferenceId();
$referenceId = 'foo';

$processor->setReferenceId($referenceId);
Expand All @@ -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']);
Expand Down

0 comments on commit 2ff3617

Please sign in to comment.