File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
src/Picqer/Financials/Moneybird
tests/PicqerTest/Financials/Moneybird Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ public function getDirtyValues()
214214 */
215215 public function isAttributeDirty ($ attributeName )
216216 {
217- if (in_array ($ attributeName , $ this ->attribute_changes )) {
217+ if (array_key_exists ($ attributeName , $ this ->attribute_changes )) {
218218 return true ;
219219 }
220220
Original file line number Diff line number Diff line change @@ -114,6 +114,9 @@ public function testRegisterAttributesAsDirty()
114114 $ this ->assertEquals ('id ' , $ invoice ->getDirty ()[0 ]);
115115 $ this ->assertEquals ('invoice_date ' , $ invoice ->getDirty ()[1 ]);
116116 $ this ->assertEquals (2 , count ($ invoice ->getDirty ()));
117+ $ this ->assertTrue ($ invoice ->isAttributeDirty ('id ' ));
118+ $ this ->assertTrue ($ invoice ->isAttributeDirty ('invoice_date ' ));
119+ $ this ->assertFalse ($ invoice ->isAttributeDirty ('unknown_key ' ));
117120
118121 //check if the getDirtyValues from is null (new object)
119122 $ this ->assertEquals (null , $ invoice ->getDirtyValues ()['invoice_date ' ]['from ' ]);
You can’t perform that action at this time.
0 commit comments