Make WordPress Core

Ticket #35105: stranger-node-things.diff

File stranger-node-things.diff, 23.1 KB (added by netweb, 8 years ago)
  • branches/3.7/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "4.7.2"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPLv2 or later",
    1114  "devDependencies": {
  • branches/3.7/tests/phpunit/tests/basic.php

     
    2222                $this->assertTrue($this->val);
    2323        }
    2424
     25        function test_readme() {
     26                $readme = file_get_contents( ABSPATH . 'readme.html' );
     27                preg_match( '#<br /> Version (.*)#', $readme, $matches );
     28                list( $version ) = explode( '-', $GLOBALS['wp_version'] );
     29                $this->assertEquals( $version, trim( $matches[1] ), "readme.html's version needs to be updated to $version." );
     30        }
     31
     32        function test_license() {
     33                $license = file_get_contents( ABSPATH . 'license.txt' );
     34                preg_match( '#Copyright (\d+) by the contributors#', $license, $matches );
     35                $this_year = date( 'Y' );
     36                $this->assertEquals( $this_year, trim( $matches[1] ), "license.txt's year needs to be updated to $this_year." );
     37        }
     38
     39        function test_package_json() {
     40                $package_json = file_get_contents( dirname( ABSPATH ) . '/package.json' );
     41                $package_json = json_decode( $package_json, true );
     42                list( $version ) = explode( '-', $GLOBALS['wp_version'] );
     43                // package.json uses x.y.z, so fill cleaned $wp_version for .0 releases
     44                if ( 1 == substr_count( $version, '.' ) ) {
     45                        $version .= '.0';
     46                }
     47                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     48                return $package_json;
     49        }
     50
     51        /**
     52         * @depends test_package_json
     53         */
     54        function test_package_json_node_engine( $package_json ) {
     55                $this->assertArrayHasKey( 'engines', $package_json );
     56                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     57                $node = $package_json['engines']['node'];
     58                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
     59        }
     60
    2561        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
    2662        function test_globals() {
    2763                global $test_foo;
  • branches/3.8/.travis.yml

     
    11language: php
    22
    33php:
    4     - "5.2"
    5     - "5.3"
    6     - "5.4"
    7     - "5.5"
     4  - "5.2"
     5  - "5.3"
     6  - "5.4"
     7  - "5.5"
    88
    99before_script:
    10     - mysql -e "CREATE DATABASE wordpress_tests;" -uroot
    11     - cp wp-tests-config-sample.php wp-tests-config.php
    12     - sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
    13     - sed -i "s/yourusernamehere/travis/" wp-tests-config.php
    14     - sed -i "s/yourpasswordhere//" wp-tests-config.php
    15     - svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
    16     - npm install -g grunt-cli
    17     - npm install
     10  - mysql -e "CREATE DATABASE wordpress_tests;" -uroot
     11  - cp wp-tests-config-sample.php wp-tests-config.php
     12  - sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
     13  - sed -i "s/yourusernamehere/travis/" wp-tests-config.php
     14  - sed -i "s/yourpasswordhere//" wp-tests-config.php
     15  - svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
     16  - npm --version
     17  - node --version
     18  - nvm install 4.7.2
     19  - npm install -g grunt-cli
     20  - npm install
     21  - mysql --version
     22  - phpenv versions
     23  - npm --version
     24  - node --version
    1825
    1926script: grunt test
     27 No newline at end of file
  • branches/3.8/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "4.7.2"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPLv2 or later",
    1114  "devDependencies": {
  • branches/3.8/tests/phpunit/tests/basic.php

     
    2929                $this->assertEquals( $version, trim( $matches[1] ), "readme.html's version needs to be updated to $version." );
    3030        }
    3131
     32        function test_license() {
     33                $license = file_get_contents( ABSPATH . 'license.txt' );
     34                preg_match( '#Copyright (\d+) by the contributors#', $license, $matches );
     35                $this_year = date( 'Y' );
     36                $this->assertEquals( $this_year, trim( $matches[1] ), "license.txt's year needs to be updated to $this_year." );
     37        }
     38
     39        function test_package_json() {
     40                $package_json = file_get_contents( dirname( ABSPATH ) . '/package.json' );
     41                $package_json = json_decode( $package_json, true );
     42                list( $version ) = explode( '-', $GLOBALS['wp_version'] );
     43                // package.json uses x.y.z, so fill cleaned $wp_version for .0 releases
     44                if ( 1 == substr_count( $version, '.' ) ) {
     45                        $version .= '.0';
     46                }
     47                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     48                return $package_json;
     49        }
     50
     51        /**
     52         * @depends test_package_json
     53         */
     54        function test_package_json_node_engine( $package_json ) {
     55                $this->assertArrayHasKey( 'engines', $package_json );
     56                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     57                $node = $package_json['engines']['node'];
     58                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
     59        }
     60
    3261        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
    3362        function test_globals() {
    3463                global $test_foo;
  • branches/3.9/.travis.yml

     
    11language: php
    22
    33php:
    4     - "5.2"
    5     - "5.3"
    6     - "5.4"
    7     - "5.5"
     4  - "5.2"
     5  - "5.3"
     6  - "5.4"
     7  - "5.5"
    88
    99before_script:
    10     - mysql -e "CREATE DATABASE wordpress_tests;" -uroot
    11     - cp wp-tests-config-sample.php wp-tests-config.php
    12     - sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
    13     - sed -i "s/yourusernamehere/travis/" wp-tests-config.php
    14     - sed -i "s/yourpasswordhere//" wp-tests-config.php
    15     - svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
    16     - npm install -g grunt-cli
    17     - npm install
     10  - mysql -e "CREATE DATABASE wordpress_tests;" -uroot
     11  - cp wp-tests-config-sample.php wp-tests-config.php
     12  - sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
     13  - sed -i "s/yourusernamehere/travis/" wp-tests-config.php
     14  - sed -i "s/yourpasswordhere//" wp-tests-config.php
     15  - svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
     16  - npm --version
     17  - node --version
     18  - nvm install 4.7.2
     19  - npm install -g grunt-cli
     20  - npm install
     21  - mysql --version
     22  - phpenv versions
     23  - npm --version
     24  - node --version
    1825
    19 script: grunt travis
     26script: grunt travis
  • branches/3.9/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "4.7.2"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPLv2 or later",
    1114  "devDependencies": {
  • branches/3.9/tests/phpunit/tests/basic.php

     
    4545                        $version .= '.0';
    4646                }
    4747                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     48                return $package_json;
     49        }
     50
     51        /**
     52         * @depends test_package_json
     53         */
     54        function test_package_json_node_engine( $package_json ) {
     55                $this->assertArrayHasKey( 'engines', $package_json );
     56                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     57                $node = $package_json['engines']['node'];
     58                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
    4859        }
    4960
    5061        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
  • branches/4.0/.travis.yml

     
    4040
    4141# Before script, failures in this section will result in build status 'failed'
    4242before_script:
    43   - npm install -g grunt-cli
    44   - npm install
     43- npm --version
     44- node --version
     45- nvm install 4.7.2
     46- npm install -g grunt-cli
     47- npm install
     48- mysql --version
     49- phpenv versions
     50- npm --version
     51- node --version
    4552
    4653# Script, failures in this section will result in build status 'failed'
    4754script: grunt $WP_TRAVISCI
  • branches/4.0/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "4.7.2"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPLv2 or later",
    1114  "devDependencies": {
  • branches/4.0/tests/phpunit/tests/basic.php

     
    4444                        $version .= '.0';
    4545                }
    4646                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     47                return $package_json;
     48        }
     49
     50        /**
     51         * @depends test_package_json
     52         */
     53        function test_package_json_node_engine( $package_json ) {
     54                $this->assertArrayHasKey( 'engines', $package_json );
     55                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     56                $node = $package_json['engines']['node'];
     57                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
    4758        }
    4859
    4960        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
  • branches/4.1/.travis.yml

     
    3939
    4040# Before script, failures in this section will result in build status 'failed'
    4141before_script:
    42   - npm install -g grunt-cli
    43   - npm install
     42- npm --version
     43- node --version
     44- nvm install 4.7.2
     45- npm install -g grunt-cli
     46- npm install
     47- mysql --version
     48- phpenv versions
     49- npm --version
     50- node --version
    4451
    4552# Script, failures in this section will result in build status 'failed'
    4653script: grunt $WP_TRAVISCI
  • branches/4.1/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "4.7.2"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPLv2 or later",
    1114  "devDependencies": {
     
    2124    "grunt-contrib-qunit": "~0.5.2",
    2225    "grunt-contrib-uglify": "~0.6.0",
    2326    "grunt-contrib-watch": "~0.6.1",
    24     "grunt-cssjanus": "git://github.com/ocean90/grunt-cssjanus.git#97c43554ff7a86e2ff414d34e66725b05118bf10",
     27    "grunt-cssjanus": "0.2.4",
    2528    "grunt-jsvalidate": "~0.2.2",
    2629    "grunt-legacy-util": "^0.2.0",
    2730    "grunt-patch-wordpress": "~0.2.1",
  • branches/4.1/tests/phpunit/tests/basic.php

     
    4444                        $version .= '.0';
    4545                }
    4646                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     47                return $package_json;
     48        }
     49
     50        /**
     51         * @depends test_package_json
     52         */
     53        function test_package_json_node_engine( $package_json ) {
     54                $this->assertArrayHasKey( 'engines', $package_json );
     55                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     56                $node = $package_json['engines']['node'];
     57                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
    4758        }
    4859
    4960        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
  • branches/4.2/.travis.yml

     
    3434      svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
    3535  fi
    3636before_script:
    37 - npm install -g npm
     37- npm --version
     38- node --version
     39- nvm install 4.7.2
    3840- npm install -g grunt-cli
    3941- npm install
     42- mysql --version
     43- phpenv versions
     44- npm --version
     45- node --version
    4046script: grunt $WP_TRAVISCI
    4147notifications:
    4248  slack:
  • branches/4.2/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "4.7.2"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPLv2 or later",
    1114  "devDependencies": {
  • branches/4.2/tests/phpunit/tests/basic.php

     
    4444                        $version .= '.0';
    4545                }
    4646                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     47                return $package_json;
     48        }
     49
     50        /**
     51         * @depends test_package_json
     52         */
     53        function test_package_json_node_engine( $package_json ) {
     54                $this->assertArrayHasKey( 'engines', $package_json );
     55                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     56                $node = $package_json['engines']['node'];
     57                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
    4758        }
    4859
    4960        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
  • branches/4.3/.travis.yml

     
    3434      svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
    3535  fi
    3636before_script:
    37 - npm install -g npm
     37- npm --version
     38- node --version
     39- nvm install 4.7.2
    3840- npm install -g grunt-cli
    3941- npm install
     42- mysql --version
     43- phpenv versions
     44- npm --version
     45- node --version
    4046script: grunt $WP_TRAVISCI
    4147notifications:
    4248  slack:
  • branches/4.3/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "4.7.2"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPL-2.0+",
    1114  "devDependencies": {
  • branches/4.3/tests/phpunit/tests/basic.php

     
    4444                        $version .= '.0';
    4545                }
    4646                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     47                return $package_json;
     48        }
     49
     50        /**
     51         * @depends test_package_json
     52         */
     53        function test_package_json_node_engine( $package_json ) {
     54                $this->assertArrayHasKey( 'engines', $package_json );
     55                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     56                $node = $package_json['engines']['node'];
     57                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
    4758        }
    4859
    4960        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
  • branches/4.4/.travis.yml

     
    4444    echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    4545  fi
    4646before_script:
    47 - npm install -g npm
     47- npm --version
     48- node --version
     49- nvm install 4.7.2
    4850- npm install -g grunt-cli
    4951- npm install
     52- mysql --version
     53- phpenv versions
    5054- npm --version
    5155- node --version
    5256script: grunt $WP_TRAVISCI
  • branches/4.4/package.json

     
    88  },
    99  "author": "The WordPress Contributors",
    1010  "license": "GPL-2.0+",
     11  "engines": {
     12    "node": "4.7.2"
     13  },
    1114  "devDependencies": {
    1215    "autoprefixer": "~6.1.0",
    1316    "grunt": "~0.4.5",
  • branches/4.4/tests/phpunit/tests/basic.php

     
    2222                        $version .= '.0';
    2323                }
    2424                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     25                return $package_json;
     26        }
     27
     28        /**
     29         * @depends test_package_json
     30         */
     31        function test_package_json_node_engine( $package_json ) {
     32                $this->assertArrayHasKey( 'engines', $package_json );
     33                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     34                $node = $package_json['engines']['node'];
     35                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
    2536        }
    2637
    2738        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
  • branches/4.5/.travis.yml

     
    4747    echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    4848  fi
    4949before_script:
    50 - npm install -g npm
     50- npm --version
     51- node --version
     52- nvm install 4.7.2
    5153- npm install -g grunt-cli
    5254- npm install
     55- npm prune
     56- mysql --version
     57- phpenv versions
    5358- npm --version
    5459- node --version
     60
    5561script: grunt $WP_TRAVISCI
    5662notifications:
    5763  slack:
  • branches/4.5/package.json

     
    88  },
    99  "author": "The WordPress Contributors",
    1010  "license": "GPL-2.0+",
     11  "engines": {
     12    "node": "4.7.2"
     13  },
    1114  "devDependencies": {
    1215    "autoprefixer": "~6.3.3",
    1316    "git-or-svn": "~0.1.0",
  • branches/4.5/tests/phpunit/tests/basic.php

     
    2222                        $version .= '.0';
    2323                }
    2424                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     25                return $package_json;
     26        }
     27
     28        /**
     29         * @depends test_package_json
     30         */
     31        function test_package_json_node_engine( $package_json ) {
     32                $this->assertArrayHasKey( 'engines', $package_json );
     33                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     34                $node = $package_json['engines']['node'];
     35                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
    2536        }
    2637
    2738        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
  • branches/4.6/.travis.yml

     
    5151    echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    5252  fi
    5353before_script:
    54 - npm install -g npm
     54- npm --version
     55- node --version
     56- nvm install 6.9.1
    5557- npm install -g grunt-cli
    5658- npm install
    5759- npm prune
     
    5961- phpenv versions
    6062- npm --version
    6163- node --version
     64
    6265script: grunt $WP_TRAVISCI
    6366notifications:
    6467  slack:
  • branches/4.6/package.json

     
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
    88  },
     9  "engines": {
     10    "node": "6.9.1"
     11  },
    912  "author": "The WordPress Contributors",
    1013  "license": "GPL-2.0+",
    1114  "devDependencies": {
  • branches/4.6/tests/phpunit/tests/basic.php

     
    2222                        $version .= '.0';
    2323                }
    2424                $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     25                return $package_json;
    2526        }
    2627
     28        /**
     29         * @depends test_package_json
     30         */
     31        function test_package_json_node_engine( $package_json ) {
     32                $this->assertArrayHasKey( 'engines', $package_json );
     33                $this->assertArrayHasKey( 'node', $package_json['engines'] );
     34                $node = $package_json['engines']['node'];
     35                $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
     36        }
     37
    2738        // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
    2839        function test_globals() {
    2940                global $test_foo;
  • branches/4.7/.travis.yml

     
    5252    echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    5353  fi
    5454before_script:
     55- npm --version
     56- node --version
    5557- npm install -g npm
    5658- npm install -g grunt-cli
    5759- npm install
  • trunk/.travis.yml

     
    5252    echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
    5353  fi
    5454before_script:
    55 - npm install -g npm
     55- npm --version
     56- node --version
     57- nvm install 6.9.1
    5658- npm install -g grunt-cli
    5759- npm install
    5860- npm prune