/**
  * tests if criteria modification in beforeFind() does not overide scopes defined by already applied criteria
  * @dataProvider postCriteriaProviderLazy
  */
 public function testBeforeFindRelationalLazyCriteriaScopes($criteria, $count, $assertations)
 {
     PostWithWrappers::setBeforeFindCriteria($criteria);
     $user = UserWithWrappers::model()->findByPk(2);
     $posts = $user->postsWithScope;
     $this->assertCriteriaApplied($posts, $criteria, $count, $assertations);
     foreach ($posts as $post) {
         $this->assertEquals('replaced content', $post->content);
     }
     $user = UserWithWrappers::model()->findByPk(2);
     $posts = $user->posts(array('with' => 'comments', 'scopes' => array('replaceContent')));
     $this->assertCriteriaApplied($posts, $criteria, $count, $assertations);
     foreach ($posts as $post) {
         $this->assertTrue($post->hasRelated('comments'));
         $this->assertEquals('replaced content', $post->content);
     }
 }