public function enable()
    {
        $registry = MockRegistry::getInstance();
        if ($registry->isRegistered($this)) {
            throw new MockEnabledException(
                "$this->name is already enabled."
                . "Call disable() on the existing mock."
            );
        }
        $this->define();
        $registry->register($this);
    }
public function enable()
    {
        $registry = MockRegistry::getInstance();
        if ($registry->isRegistered($this)) {
            throw new MockEnabledException(
                "$this->name is already enabled."
                . "Call disable() on the existing mock."
            );
        }
        $this->define();
        $registry->register($this);
    }
public function enable ( ) { $ registry = MockRegistry :: getInstance ( ) ; if ( $ registry -> isRegistered ( $ this ) ) { throw new MockEnabledException ( "$this->name is already enabled." . "Call disable() on the existing mock." ) ; } $ this -> define ( ) ; $ registry -> register ( $ this ) ; }
Enables this mock.

@throws MockEnabledException If the function has already an enabled mock.
@see Mock::disable()
@see Mock::disableAll()

@SuppressWarnings(PHPMD)
Enables this mock .