Skip to content

Commit 8c8fbcf

Browse files
authored
Merge pull request #41 from repzy/issue40_fix
fix issue #40
2 parents 70d3c38 + 65b3b3a commit 8c8fbcf

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

src/Grphp/Client/Interceptors/Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ abstract class Base
3737
/** @var string */
3838
protected $method;
3939
/** @var array */
40-
protected $metadata;
40+
protected $metadata = [];
4141
/** @var BaseStub */
4242
protected $stub;
4343

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
/**
4+
* Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
8+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
12+
* Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
15+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18+
*/
19+
declare(strict_types=1);
20+
21+
namespace Unit\Grphp\Client\Interceptors;
22+
23+
use Grphp\Client\Interceptors\Timer;
24+
use PHPUnit\Framework\TestCase;
25+
26+
class TimerTest extends TestCase
27+
{
28+
public function testMetadataReturnedAsArray()
29+
{
30+
$timer = new Timer([]);
31+
32+
$this->assertSame([], $timer->getMetadata());
33+
}
34+
}

0 commit comments

Comments
 (0)