Skip to content

Commit 1116e94

Browse files
committed
update test instructions
add contributing information use composer autoload for tests
1 parent 083c446 commit 1116e94

File tree

4 files changed

+59
-21
lines changed

4 files changed

+59
-21
lines changed

Diff for: CONTRIBUTING.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Contributing to PHP ActiveRecord #
2+
3+
We always appreciate contributions to PHP ActiveRecord, but we are not always able to respond as quickly as we would like.
4+
Please do not take delays personal and feel free to remind us by commenting on issues.
5+
6+
### Testing ###
7+
8+
PHP ActiveRecord has a full set of unit tests, which are run by PHPUnit.
9+
10+
In order to run these unit tests, you need to install the required packages using [Composer](https://getcomposer.org/):
11+
12+
```sh
13+
composer install
14+
```
15+
16+
After that you can run the tests by invoking the local PHPUnit
17+
18+
To run all test simply use:
19+
20+
```sh
21+
vendor/bin/phpunit
22+
```
23+
24+
Or run a single test file by specifying its path:
25+
26+
```sh
27+
vendor/bin/phpunit test/InflectorTest.php
28+
```

Diff for: README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Of course, there are some differences which will be obvious to the user if they
3737
- PostgreSQL
3838
- Oracle
3939

40-
# Features ##
40+
## Features ##
4141

4242
- Finder methods
4343
- Dynamic finder methods
@@ -50,11 +50,11 @@ Of course, there are some differences which will be obvious to the user if they
5050
- Support for multiple adapters
5151
- Miscellaneous options such as: aliased/protected/accessible attributes
5252

53-
### Installation ##
53+
## Installation ##
5454

5555
Setup is very easy and straight-forward. There are essentially only three configuration points you must concern yourself with:
5656

57-
1. Setting the model auto_load directory.
57+
1. Setting the model autoload directory.
5858
2. Configuring your database connections.
5959
3. Setting the database connection to use for your environment.
6060

@@ -164,3 +164,7 @@ $post->delete();
164164
# DELETE FROM `posts` WHERE id=1
165165
echo $post->title; # 'New real title'
166166
```
167+
168+
## Contributing ##
169+
170+
Please refer to [CONTRIBUTING.md](https://github.com/jpfuentes2/php-activerecord/blob/master/CONTRIBUTING.md) for information on how to contribute to PHP ActiveRecord.

Diff for: composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
},
1111
"require-dev": {
1212
"phpunit/phpunit": "3.7.*",
13-
"pear/pear_exception": "1.0.*@dev",
14-
"pear/Log": "dev-master"
13+
"pear/pear_exception": "1.0-beta1",
14+
"pear/log": "~1.12"
1515
},
1616
"autoload": {
1717
"files": [ "ActiveRecord.php" ]

Diff for: test/helpers/config.php

+22-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
<?php
2+
23
/**
3-
* In order to run these unit tests, you need to install:
4-
* - PHPUnit
5-
* - PEAR Log (otherwise logging SQL queries will be disabled)
6-
* - Memcache (otherwise Caching tests will not be executed)
7-
*
8-
* To run all tests : phpunit AllTests.php --slow-tests
9-
* To run a specific test : phpunit ????Test.php
10-
*/
11-
12-
set_include_path(get_include_path() . PATH_SEPARATOR . './vendor/phpunit/PHPUnit'
13-
. PATH_SEPARATOR . './vendor/pear/log');
14-
15-
@include_once 'Log.php';
16-
@include_once 'Log/file.php';
17-
require_once 'PHPUnit/Framework/TestCase.php';
4+
* In order to run these unit tests, you need to install the required packages using Composer:
5+
*
6+
* $ composer install
7+
*
8+
* After that you can run the tests by invoking the local PHPUnit
9+
*
10+
* To run all test simply use:
11+
*
12+
* $ vendor/bin/phpunit
13+
*
14+
* Or run a single test file by specifying its path:
15+
*
16+
* $ vendor/bin/phpunit test/InflectorTest.php
17+
*
18+
**/
19+
20+
require_once 'vendor/autoload.php';
21+
1822
require_once 'SnakeCase_PHPUnit_Framework_TestCase.php';
23+
1924
require_once 'DatabaseTest.php';
2025
require_once 'AdapterTest.php';
26+
2127
require_once __DIR__ . '/../../ActiveRecord.php';
2228

2329
// whether or not to run the slow non-crucial tests
@@ -65,7 +71,7 @@
6571
}
6672

6773
if ($GLOBALS['show_warnings'] && !isset($GLOBALS['show_warnings_done']))
68-
{
74+
{
6975
if (!extension_loaded('memcache'))
7076
echo "(Cache Tests will be skipped, Memcache not found.)\n";
7177
}

0 commit comments

Comments
 (0)