Elgg\TestCase::getInstance PHP Method

getInstance() public static method

Returns current test instance
public static getInstance ( ) : TestCase
return TestCase
    public static function getInstance()
    {
        if (!isset(self::$_instance)) {
            new self();
        }
        return self::$_instance;
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function __construct(Config $config, Logger $logger = null)
 {
     parent::__construct($config, $logger);
     $this->test = TestCase::getInstance();
 }