Skip to content

Commit 0cbfc52

Browse files
author
Mike Harrison
committed
test: added test for setting response key
1 parent c0eff15 commit 0cbfc52

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/DebuggerTest.php

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Database\Schema\Blueprint;
66
use Illuminate\Support\Facades\Cache;
7+
use Lanin\Laravel\ApiDebugger\Debugger;
78

89
class DebuggerTest extends TestCase
910
{
@@ -229,4 +230,19 @@ public function it_preserves_array()
229230
->assertStatus(200)
230231
->assertSeeText('"baz":[]');
231232
}
233+
234+
/** @test */
235+
public function it_can_set_a_new_response_key()
236+
{
237+
/** @var Debugger $debugger */
238+
$debugger = $this->app->make(Debugger::class);
239+
240+
$this->assertEquals(Debugger::DEFAULT_RESPONSE_KEY, $debugger->getResponseKey(), 'Response key is not the default');
241+
242+
$new_response_key = 'key123';
243+
244+
$debugger->setResponseKey($new_response_key);
245+
246+
$this->assertEquals($new_response_key, $debugger->getResponseKey(), 'Response key was not changed from "'.$debugger->getResponseKey().'" to "'.$new_response_key.'"');
247+
}
232248
}

0 commit comments

Comments
 (0)