Skip to content

Commit

Permalink
Add phpunit and test case boostrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustingraham committed Apr 23, 2016
1 parent e1016b7 commit de7f69d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# react-mysql
Nuclear MySQL Reactor


# Examples

Connection::init($loop);

Connection::query('SELECT * FROM `table` WHERE `column` = ? AND `column2` = ?;', ['red', 'white'])
->then(function($result) { ... });

Connection::query returns a promise. This has all of the normal promise interface options.

# Credits
Inspiration from:
- https://github.com/kaja47/async-mysql
- https://github.com/bixuehujin/reactphp-mysql
21 changes: 21 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="tests/bootstrap.php">
<testsuites>
<testsuite name="ReactMysql Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./src/</directory>
</whitelist>
</filter>
</phpunit>
3 changes: 3 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

require __DIR__.'/../vendor/autoload.php';

0 comments on commit de7f69d

Please sign in to comment.