You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Unit/ProductTest.php
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -161,12 +161,11 @@ public function product_has_custom_attributes()
161
161
{
162
162
$product = Product::find(10);
163
163
164
-
$this->assertEqualsCanonicalizing([8, 11], iterator_to_array($product->activity->rawValue), 'Activity attribute on product 10 did not return the right values.');
165
-
$this->assertEqualsCanonicalizing(['Gym', 'Yoga'], iterator_to_array($product->activity->value), 'Activity attribute on product 10 did not return the right values.');
166
-
$this->assertEquals('Gym, Yoga', $product->activity->label, 'Activity attribute on product 10 did not yield the right text output.');
164
+
$this->assertEqualsCanonicalizing([8, 11], iterator_to_array($product->raw('activity')), 'Activity attribute on product 10 did not return the right values.');
165
+
$this->assertEqualsCanonicalizing(['Gym', 'Yoga'], iterator_to_array($product->activity), 'Activity attribute on product 10 did not return the right values.');
166
+
$this->assertEquals('Gym, Yoga', $product->label('activity'), 'Activity attribute on product 10 did not yield the right text output.');
167
167
168
-
$this->assertEquals('Savvy Shoulder Tote', $product->name->label, 'Name attribute on product 10 did not return the right value.');
169
-
$this->assertEquals($product->name->label, $product->name, 'Product name did not return the right value or did not cast its value correctly.');
168
+
$this->assertEquals('Savvy Shoulder Tote', $product->label('name'), 'Name attribute on product 10 did not return the right label.');
0 commit comments