Skip to content

Commit 9162a40

Browse files
committed
Fix tests + doc
1 parent 740358b commit 9162a40

File tree

3 files changed

+31
-34
lines changed

3 files changed

+31
-34
lines changed

docs/guide/upgrading/9.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ This means you also need to remove all `$this->initSharpAssertions()` calls from
398398

399399
Of course, the test helpers remain available, see the dedicated [testing documentation](../testing-with-sharp.md).
400400

401+
Also take note that the `withSharpCurrentBreadcrumb()` method is now deprecated, in favor of the new `withSharpBreadcrumb()` method also documented in the section linked above.
402+
401403
# Dashboard
402404

403405
## `SharpWidgetPanel`s are now based on blade template

tests/Unit/Utils/Testing/SharpAssertionsTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,35 @@
171171
);
172172
});
173173

174+
it('allows to test getSharpForm for edit with a custom breadcrumb with legacy API', function () {
175+
$response = fakeResponse()
176+
->withSharpCurrentBreadcrumb(
177+
['list', 'leaves'],
178+
['show', 'leaves', 6],
179+
)
180+
->getSharpForm('leaves', 6);
181+
182+
$this->assertEquals(
183+
route('code16.sharp.form.edit', ['s-list/leaves/s-show/leaves/6', 'leaves', 6]),
184+
$response->uri,
185+
);
186+
});
187+
188+
it('allows to define a current breadcrumb with legacy API', function () {
189+
$response = fakeResponse()
190+
->withSharpCurrentBreadcrumb(
191+
['list', 'trees'],
192+
['show', 'trees', 2],
193+
['show', 'leaves', 6],
194+
)
195+
->getSharpForm('leaves', 6);
196+
197+
$this->assertEquals(
198+
'http://localhost/sharp/s-list/trees/s-show/trees/2/s-show/leaves/6/s-form/leaves/6',
199+
$response->uri,
200+
);
201+
});
202+
174203
function fakeResponse()
175204
{
176205
return new class('fake') extends Orchestra\Testbench\TestCase

tests/Unit/Utils/Testing/SharpLegacyAssertionsTest.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)