/**
  * Sets up this unit test.
  *
  * @return void
  */
 protected function setUp()
 {
     if (self::$_phpcs === null) {
         self::$_phpcs = new PHP_CodeSniffer();
         self::$_phpcs->cli->setCommandLineValues(['-s']);
     }
 }
Esempio n. 2
0
 /**
  * Prepare our code standard setup, PHP Code Sniffer performs this in:
  * PHP_CodeSniffer_AllTests and PHP_CodeSniffer_TestSuite
  *
  * @see AbstractSniffUnitTest::setUp()
  */
 protected function setUp()
 {
     $GLOBALS['PHP_CODESNIFFER_CONFIG_DATA'] = ['showSources' => true, 'colors' => true, 'default_standard' => 'Hostnet', 'installed_paths' => __DIR__ . '/../../../src/'];
     $GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'][get_class($this)] = __DIR__ . '/../..';
     $GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'] = [];
     $GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'] = [];
     parent::setUp();
 }
Esempio n. 3
0
 /**
  * Sets up this unit test.
  *
  * @return void
  */
 protected function setUp()
 {
     if (self::$phpcs === null) {
         self::$phpcs = new PHP_CodeSniffer();
     }
     $class = get_class($this);
     $this->standardsDir = $GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'][$class];
 }
 protected function setUp()
 {
     if (defined('TEST_EXT')) {
         $this->testExtension = TEST_EXT;
     }
     self::$phpcs = new PHP_CodeSniffer();
     $this->testBaseName = preg_replace("/{$this->testExtension}\$/", '', get_class($this));
 }
 /**
  * Sets up this unit test.
  *
  * @return void
  */
 protected function setUp()
 {
     if (self::$phpcs === null) {
         self::$phpcs = new PHP_CodeSniffer();
     }
 }
 protected function setUp()
 {
     parent::setUp();
     WordPress_Sniffs_Arrays_ArrayAssignmentRestrictionsSniff::$groups = array('posts_per_page' => array('type' => 'error', 'message' => 'Found assignment value of %s to be %s', 'keys' => array('foo', 'bar')));
 }
 protected function setUp()
 {
     parent::setUp();
     WordPress_Sniffs_Variables_VariableRestrictionsSniff::$groups = array('test' => array('type' => 'error', 'message' => 'Detected usage of %s', 'object_vars' => array('$foo->bar', 'FOO::var', 'FOO::reg*', 'FOO::$static'), 'array_members' => array('$foo[\'test\']'), 'variables' => array('$taz')));
 }