assertDataGet #37338
assertDataGet
#37338
Replies: 1 comment
-
Wouldn't this be more aligned with what public function test_invoice_notification()
{
$invoice = Invoice::factory()->create();
$notification = DatabaseNotification::first();
$this->assertDataGet('data.amount', $invoice->amount, $notification);
$this->assertDataGet('type', $invoice->amount, 'App\Notifications\InvoiceCreated');
}
public function assertDataGet(array $expected, $data)
{
$this->assertEquals($value, data_get($data, $path));
} This would be similar to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A test helper for
dot.notation
assertions on an object or array.Beta Was this translation helpful? Give feedback.
All reactions