Laravel 4 save hasMany return在非对象上调用成员函数save()

I am unable to locate the problem in the following example, I have been looking at the http://laravel.com/docs/eloquent#inserting-related-models but for some reason which I am unable to locate, it's not working.

Models:

class Article extends Eloquent {
  public function category()
  {
    $this->belongsTo('Category');
  }
}

class Category extends Eloquent {

  public function articles()
  {
    $this->hasMany('Article');
  }
}

DB schema:

Articles has a column called category_id which is an integer, and both Articles and Categories have increments on ID column.

Unit test which is currently failing:

  public function testCreateArticleWithCategory()
  {
    $category = new Category();
    $category->name = 'Kitties';

    $this->assertTrue($category->save());

    $cid = $category->id;

    $category = Category::find($cid);

    $article = new Article();
    $article->title = 'Hello Kitty';

    $article = $category->articles()->save($article);

    $this->assertEquals('Kitties', $article->category->name);
  }

The test is failing with the following message:

Starting test 'ArticleTest::testCreateArticleWithCategory'. PHP Fatal error: Call to a member function save() on a non-object in /Users/kristiannissen/Documents/php/sacrebleu/app/tests/ArticleTest.php on line 30

And line 30 is

$article = $category->articles()->save($article);

By your question, I am assuming that $this->assertTrue($category->save()); is passing the test?

Could you show us your schema?

Also, In your models, shouldn't you do return $this->belongsTo('Category'); and return $this->hasMany('Article');?

Shouldnt your models be as follows:

class Article extends Eloquent {
  public function category()
  {
    return $this->belongsTo('Category');
  }
}

class Category extends Eloquent {

  public function articles()
  {
    return $this->hasMany('Article');
  }
}

Try

$article = $category->articles->save($article);

instead of

$article = $category->articles()->save($article);

There's a bit of magic going on.