Ejemplo n.º 1
0
 public function testMultiValuesAttributes()
 {
     $values = new Collection(['a', 'b']);
     $attribs = new Attributes(['x' => $values]);
     $this->assertInstanceOf(Collection::class, $attribs['x']);
     $this->assertSame($values, $attribs['x']);
     $attribs->set('x', $otherValues = new Collection(['y', 'z']));
     $this->assertInstanceOf(Collection::class, $attribs['x']);
     $this->assertSame($values, $attribs['x']);
 }
Ejemplo n.º 2
0
 /**
  * @param $attribute
  *
  * @return mixed|null
  * @throws \ObjectivePHP\Primitives\Exception
  */
 public function getAttribute($attribute)
 {
     return $this->attributes->get($attribute);
 }