forked from apiton/aerospike-client-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation updated for getMany(); tests doc updated
- Loading branch information
Showing
4 changed files
with
198 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,56 @@ | ||
# Aerospike PHP Client PHPT Tests | ||
|
||
## Source Code | ||
|
||
PHPT scripts are grouped by functionality inside `src/aerospike/tests/`. | ||
Each *.inc* file contains the methods used by individual *.phpt* within | ||
the respective `src/aerospike/tests/phpt/*/` subdirectory. | ||
|
||
For example, the Put test cases are described by the list of | ||
`src/aerospike/tests/phpt/Put/*.phpt` files, which make use of methods from `src/aerospike/tests/Put.inc`. | ||
|
||
## Expected Values | ||
The structure of PHPT tests is explained at the [PHP QA site](http://qa.php.net/write-test.php#writing-phpt). | ||
|
||
The expected value for a test is the name of one of the Aerospike class | ||
constants, such as **OK** or **ERR_RECORD_NOT_FOUND** as listed in | ||
`src/aerospike/tests/astestframework/astest-phpt-loader.inc`. | ||
|
||
## Build Instructions | ||
|
||
Follow the build and installation steps described in this repository's main [README.md](../../../README.md) file. Please use a standard build (without the **-l** flag), as a debug build will cause the tests to fail. | ||
Follow the build and installation steps described in this repository's main | ||
[README.md](../../../README.md) file. Please use a standard build | ||
(without the **-l** flag), as a debug build will cause the tests to fail. | ||
|
||
## Configuration: | ||
|
||
Edit the file `src/aerospike/tests/aerospike.inc` with the IP address and port configuration of your Aerospike database server(s) before running the phpt | ||
scripts. | ||
Use the config file skeleton to create a local configuration file for the tests, | ||
and configure the correct IP address and port for your server. | ||
|
||
## Running Tests: | ||
``` | ||
cd src/aerospike/ | ||
cp tests/aerospike.local.skeleton tests/aerospike.local.inc | ||
# edit tests/aerospike.local.inc | ||
``` | ||
|
||
Change directory to `src/aerospike/` and run: | ||
## Running Tests: | ||
|
||
$ make test TESTS=tests/phpt | ||
``` | ||
make test TESTS=tests/phpt | ||
``` | ||
|
||
To run only the phpt test cases for Put: | ||
|
||
$ make test TESTS=tests/phpt/Put | ||
``` | ||
make test TESTS=tests/phpt/Put | ||
``` | ||
|
||
|
||
## Cleanup | ||
|
||
To clean up artifacts created by the tests you can run: | ||
|
||
$ test-cleanup | ||
``` | ||
./srcipts/test-cleanup.sh | ||
``` | ||
|
||
##Secondary Index Dependency | ||
|
||
For the following testcases of aggregate to pass you need to first create Secondary Index. | ||
## Source Code | ||
|
||
$ tests/phpt/Aggregate/TestAggregatePositiveEmptyAggregationResult.phpt | ||
PHPT scripts are grouped by functionality inside `src/aerospike/tests/`. | ||
Each *.inc* file contains the methods used by individual *.phpt* within | ||
the respective `src/aerospike/tests/phpt/*/` subdirectory. | ||
|
||
You can create secondary index using aql tool. | ||
The steps are, | ||
For example, the Put test cases are described by the list of | ||
`src/aerospike/tests/phpt/Put/*.phpt` files, which make use of methods from `src/aerospike/tests/Put.inc`. | ||
|
||
$ CREATE INDEX ix2 ON user_profile.west (location) string | ||
## Expected Values | ||
The structure of PHPT tests is explained at the | ||
[PHP QA site](http://qa.php.net/write-test.php#writing-phpt). | ||
|
||
Above aql script creates a string index 'ix2' on the namespace called | ||
'user_profile', set-name 'west', bin-name 'location'. | ||
The expected value for a test is the name of one of the | ||
[Aerospike class](../../../doc/aerospike.md) constants, such as **OK** | ||
or **ERR_RECORD_NOT_FOUND**. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
// modify the address and port information according to your config | ||
define("AEROSPIKE_CONFIG_NAME", "127.0.0.1"); | ||
define("AEROSPIKE_CONFIG_PORT", 3000); | ||
|
||
|
||
// if you have more than one node in the cluster, uncomment the following | ||
// and provide connection information for a second node in the cluster | ||
//define("AEROSPIKE_CONFIG_NAME2", "127.0.0.1"); | ||
//define("AEROSPIKE_CONFIG_PORT2", 3010); | ||
|
||
// if the database is Enterprise Edition, run security tests | ||
define("AEROSPIKE_ENTERPRISE_EDITION", false); | ||
?> |