コード例 #1
0
ファイル: AttributeSpec.php プロジェクト: manishkiozen/Cms
 function it_can_be_registered()
 {
     $attribute = Attribute::register('Author', 'string');
     \PHPUnit_Framework_Assert::assertEquals('Author', $attribute->description);
     \PHPUnit_Framework_Assert::assertEquals('string', $attribute->type);
 }
コード例 #2
0
 /**
  * Execute the command.
  *
  * @param AttributeRepository $attributes
  * @return Attribute
  */
 public function handle(AttributeRepository $attributes)
 {
     $attribute = Attribute::register($this->description, $this->type);
     $attributes->save($attribute);
     return $attribute;
 }