public function mock($pattern, $ifNotExist = false)
    {
        if ($ifNotExist) {
            $this->_optionalMockPatterns[] = $pattern;
        } else {
            $this->_mockPatterns[] = $pattern;
        }

        return $this;
    }
public function mock($pattern, $ifNotExist = false)
    {
        if ($ifNotExist) {
            $this->_optionalMockPatterns[] = $pattern;
        } else {
            $this->_mockPatterns[] = $pattern;
        }

        return $this;
    }
public function mock ( $ pattern , $ ifNotExist = false ) { if ( $ ifNotExist ) { $ this -> _optionalMockPatterns [ ] = $ pattern ; } else { $ this -> _mockPatterns [ ] = $ pattern ; } return $ this ; }
Mock any class matching the given pattern

e.g.
mock('Mage*')
mock('Mage*Collection')
mock('Foo\Bar\*')

@param string $pattern
@param bool $ifNotExist

@return $this
Mock any class matching the given pattern