RedUNIT\Base\Bean::testAccessingTainting PHP Method

testAccessingTainting() public method

Test whether the tainted flag gets set correctly.
public testAccessingTainting ( ) : void
return void
    public function testAccessingTainting()
    {
        $book = $this->_createBook();
        asrt($book->isTainted(), FALSE);
        $book->ownPage;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->author;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->fetchAs('author')->coauthor;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->alias('magazine')->xownAdList;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->title = 'Hello';
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->sharedTag;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->via('connection')->sharedUser;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->coauthor;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->ownFakeList;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->sharedFakeList;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->alias('fake')->ownFakeList;
        asrt($book->isTainted(), TRUE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->title;
        asrt($book->isTainted(), FALSE);
        $book = $book->fresh();
        asrt($book->isTainted(), FALSE);
        $book->title = 1;
        $book->setMeta('tainted', FALSE);
        asrt($book->isTainted(), FALSE);
    }