File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ public function testSetGetAttribute()
40
40
$ value ->setName ('Silver ' );
41
41
$ this ->assertSame ($ attribute , $ value ->getAttribute ());
42
42
43
- $ value ->setAttribute ($ attribute );
44
- $ this ->assertSame ($ attribute , $ value ->getAttribute ());
43
+ $ this ->assertSame ($ attribute , $ value ->setAttribute ($ attribute )->getAttribute ());
45
44
}
46
45
}
Original file line number Diff line number Diff line change @@ -28,12 +28,15 @@ public function __construct(Attribute $attribute)
28
28
29
29
/**
30
30
* @param Attribute $attribute
31
+ * @return $this
31
32
*/
32
33
public function setAttribute (Attribute $ attribute )
33
34
{
34
35
$ this ->attribute ->removeValue ($ this ); // Remove value from current attribute
35
36
$ attribute ->addValue ($ this ); // Add value to new attribute
36
37
$ this ->attribute = $ attribute ;
38
+
39
+ return $ this ;
37
40
}
38
41
39
42
/**
You can’t perform that action at this time.
0 commit comments