mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 08:14:44 -04:00
Working on data matching
This commit is contained in:
parent
3d397b40e3
commit
80abcda831
@ -29,6 +29,52 @@ class YodleeApiTest extends TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testDataMatching()
|
||||||
|
{
|
||||||
|
|
||||||
|
$transaction = collect([
|
||||||
|
(object)[
|
||||||
|
'description' => 'tinkertonkton'
|
||||||
|
],
|
||||||
|
(object)[
|
||||||
|
'description' => 'spud'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertEquals(2, $transaction->count());
|
||||||
|
|
||||||
|
$hit = $transaction->where('description', 'spud')->first();
|
||||||
|
|
||||||
|
$this->assertNotNull($hit);
|
||||||
|
|
||||||
|
$hit = $transaction->where('description', 'tinkertonkton')->first();
|
||||||
|
|
||||||
|
$this->assertNotNull($hit);
|
||||||
|
|
||||||
|
$hit = $transaction->contains('description', 'tinkertonkton');
|
||||||
|
|
||||||
|
$this->assertTrue($hit);
|
||||||
|
|
||||||
|
|
||||||
|
$transaction = collect([
|
||||||
|
(object)[
|
||||||
|
'description' => 'tinker and spice'
|
||||||
|
],
|
||||||
|
(object)[
|
||||||
|
'description' => 'spud with water'
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$hit = $transaction->contains('description', 'tinker and spice');
|
||||||
|
|
||||||
|
$this->assertTrue($hit);
|
||||||
|
|
||||||
|
$transaction->contains(function ($value, $key) {
|
||||||
|
return str_contains($value->description, 'tinker');
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function testYodleeInstance()
|
public function testYodleeInstance()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -435,4 +481,6 @@ class YodleeApiTest extends TestCase
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user