本文整理匯總了PHP中Author::attributes方法的典型用法代碼示例。如果您正苦於以下問題:PHP Author::attributes方法的具體用法?PHP Author::attributes怎麽用?PHP Author::attributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Author
的用法示例。
在下文中一共展示了Author::attributes方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testShouldHaveAllColumnAttributesWhenInitializingWithArray
public function testShouldHaveAllColumnAttributesWhenInitializingWithArray()
{
$author = new Author(array('name' => 'Tito'));
$this->assertTrue(count(array_keys($author->attributes())) >= 9);
}
示例2: test_should_have_all_column_attributes_when_initializing_with_array
public function test_should_have_all_column_attributes_when_initializing_with_array()
{
$author = new Author(array('name' => 'Tito'));
$this->assert_true(count(array_keys($author->attributes())) >= 9);
}
示例3: it_can_mass_assign_the_values_on_init
/** @test **/
public function it_can_mass_assign_the_values_on_init()
{
$attributes = ['first_name' => 'Burton', 'last_name' => 'Guster'];
$author = new Author($attributes);
$this->assertEquals($attributes, $author->attributes());
}