Elgg\TestCase::getInstance PHP 메소드

getInstance() 공개 정적인 메소드

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

Usage Example

예제 #1
0
파일: Database.php 프로젝트: elgg/elgg
 /**
  * {@inheritdoc}
  */
 public function __construct(Config $config, Logger $logger = null)
 {
     parent::__construct($config, $logger);
     $this->test = TestCase::getInstance();
 }