Skip to content

Commit b0f25e4

Browse files
committed
Add tests for setting multiple attributes
1 parent a41402d commit b0f25e4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/wpunit/ModelTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,17 @@ public function testShouldThrowExceptionForSettingMissingProperty() {
266266
$model->iDontExist = 'foo';
267267
}
268268

269+
public function testShouldSetMultipleAttributes() {
270+
$model = new MockModel();
271+
$model->setAttributes( [
272+
'firstName' => 'Luke',
273+
'lastName' => 'Skywalker',
274+
] );
275+
276+
$this->assertEquals( 'Luke', $model->firstName );
277+
$this->assertEquals( 'Skywalker', $model->lastName );
278+
}
279+
269280
/**
270281
* @since 1.0.0
271282
*

0 commit comments

Comments
 (0)