Git Product home page Git Product logo

yourls-unit-tests's Introduction

Unit Tests for YOURLS Build Status

About

This is the unit test suite for YOURLS : a collection of hundreds of tests to make sure that whenever something in YOURLS is added, changed or removed, everything still works under all the supported PHP versions.

Tests

If you want to run tests locally:

  1. Install PHPUnit (which is as simple as writing a composer command, or downloading a .phar archive)
  2. Copy your existent YOURLS version into a new YOURLS/ subdirectory, or clone the YOURLS repository:
$ git clone https://github.com/YOURLS/YOURLS.git
  1. Create an empty MySQL database and user. Do not use an exisiting database or you will lose data, guaranteed.
  2. Copy yourls-tests-config-sample.php to yourls-tests-config.php, edit it and include your database name, user and password.
  3. In that same directory, run the tests:
$ phpunit

Hopefully you should see something like the following appear:

PHPUnit 5.3.0 by Sebastian Bergmann and contributors.

Configuration read from /home/your/test/dir/tests/phpunit-travis.xml.dist

...............................................................  63 / 519 ( 12%)
............................................................... 126 / 519 ( 24%)
............................................................... 189 / 519 ( 36%)
............................................................... 252 / 519 ( 48%)
............................................................... 315 / 519 ( 60%)
............................................................... 378 / 519 ( 72%)
............................................................... 441 / 519 ( 84%)
............................................................... 504 / 519 ( 97%)
...............                                                 519 / 519 (100%)

Time: 6.06 seconds, Memory: 24.25Mb

OK (519 tests, 1123 assertions)

Notes

  • When run locally (as opposed to when in the Travis-CI environment) the test script will start by dropping all tables in the selected database. Again, do not use an existing database.

  • Test cases live in the tests/ subdirectory. All files in that directory will be included by default.
    PHPUnit will initialize and install a complete running copy of YOURLS each time it is run.

  • PHPUnit supports both phpunit.xml and phpunit.xml.dist, where phpunit.xml has higher priority: if you want to specify your own settings, copy phpunit.xml.dist to phpunit.xml and edit that file.

yourls-unit-tests's People

Contributors

ozh avatar leocolomb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.