Skip to content

Commit 92f5c9a

Browse files
committed
added some tests
1 parent 91c7d2b commit 92f5c9a

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

.codeclimate.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
engines:
3+
fixme:
4+
enabled: false
5+
shellcheck:
6+
enabled: true
7+
ratings:
8+
paths:
9+
- "**.sh"
10+
exclude_paths:
11+
- archs/
12+
- config/
13+
- test/
14+
- inst/
15+
- src/
16+

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# php-band
22

33
<img src="https://circleci.com/gh/francisek/php-band/tree/master.svg?style=shield&circle-token=0e2b5681405bbc52e77bce982d74c449b46636d8" />
4+
[![Code Climate](https://codeclimate.com/github/francisek/php-band/badges/gpa.svg)](https://codeclimate.com/github/francisek/php-band)
45

56
A simple bash tool to compile php versions
67

test/20_pecl_extensions.bats

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bats
2+
3+
load test_helper
4+
5+
setup() {
6+
source $BATS_TEST_DIRNAME/../lib/core.sh
7+
}
8+
9+
@test "Install a single extension" {
10+
local output
11+
php_band_php_install_dir="${BATS_TEST_DIRNAME}/mock"
12+
output=$(php_band_pecl_build_extension 'test')
13+
assert_equals "Building pecl extension test" "$output"
14+
}
15+
16+
@test "Request installation of a pecl extension" {
17+
local input='n\n'
18+
local output
19+
php_band_php_install_dir="${BATS_TEST_DIRNAME}/mock"
20+
php_band_pecl_add_package 'test' "$input"
21+
assert_equals "$input" "${PHP_BAND_CUSTOM_PECL_EXTENSIONS[test]}"
22+
}
23+
24+

test/mock/bin/pecl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Pecl called with '$@'"
4+
exit 0

0 commit comments

Comments
 (0)