Skip to content

Commit 0d9ffe6

Browse files
committed
Switch to updated TravisCI config
1 parent b843f6a commit 0d9ffe6

File tree

9 files changed

+94
-10
lines changed

9 files changed

+94
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: php
2+
3+
php:
4+
- 5.5
5+
- 5.4
6+
- 5.3
7+
8+
before_script:
9+
- composer install --dev
10+
11+
script: phpunit --configuration phpunit.xml.dist test

build/phing/test.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
passthru="true"
1818
checkreturn="true"
1919
command="phpunit --log-junit "${path.logs}/vectors.xml"
20-
--configuration "${path.tests}/phpunit.xml.dist"
20+
--configuration "${project.basedir}/phpunit.xml.dist"
2121
"${path.tests}/Vectors""
2222
/>
2323
</target>
@@ -28,7 +28,7 @@
2828
passthru="true"
2929
checkreturn="true"
3030
command="phpunit --log-junit &quot;${path.logs}/junit.xml&quot;
31-
--configuration &quot;${path.tests}/phpunit.xml.dist&quot;
31+
--configuration &quot;${project.basedir}/phpunit.xml.dist&quot;
3232
&quot;${path.tests}/Unit&quot;"
3333
/>
3434
</target>
@@ -43,7 +43,7 @@
4343
command="phpunit --log-junit &quot;${path.logs}/junit.xml&quot;
4444
--coverage-clover &quot;${path.logs}/clover.xml&quot;
4545
--coverage-html &quot;${path.results}/coverage&quot;
46-
--configuration &quot;${path.tests}/phpunit.xml.dist&quot;"
46+
--configuration &quot;${project.basedir}/phpunit.xml.dist&quot;"
4747
/>
4848
<phingcall target="vectors" />
4949
</target>

composer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "CryptLib/CryptLib",
3+
"type": "library",
4+
"version": "0.0.1-alpha1",
5+
"description": "A General Purpose Cryptography Library",
6+
"keywords": ["encryption", "cryptography", "cipher"],
7+
"homepage": "https://github.com/ircmaxell/PHP-CryptLib",
8+
"license": "MIT",
9+
"authors": [
10+
{
11+
"name": "Anthony Ferrara",
12+
"email": "[email protected]",
13+
"homepage": "http://blog.ircmaxell.com"
14+
}
15+
],
16+
"require-dev": {
17+
"mikey179/vfsStream": "1.1.*"
18+
},
19+
"require": {
20+
"php": ">=5.3.2"
21+
},
22+
"autoload": {
23+
"psr-0": {
24+
"CryptLib": "lib"
25+
}
26+
}
27+
}

composer.lock

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/CryptLib/Random/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function generateString($length, $characters = '') {
154154
'ABCDEFGHIJKLMNOPQRSTUVWXYZ./';
155155
}
156156
//determine how many bytes to generate
157-
$bytes = ceil($length * floor(log(strlen($characters), 2) + 1) / 8);
157+
$bytes = ceil($length * floor(log(strlen($characters), 2) + 1.01) / 8);
158158
$rand = $this->generate($bytes);
159159
$result = BaseConverter::convertFromBinary($rand, $characters);
160160
if (strlen($result) < $length) {

test/phpunit.xml.dist renamed to phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit backupGlobals="true"
33
backupStaticAttributes="false"
4-
bootstrap="./bootstrap.php"
4+
bootstrap="test/bootstrap.php"
55
colors="false"
66
convertErrorsToExceptions="true"
77
convertNoticesToExceptions="true"
@@ -18,12 +18,12 @@
1818
verbose="false">
1919
<testsuites>
2020
<testsuite name="Unit">
21-
<directory>./Unit</directory>
21+
<directory>test/Unit</directory>
2222
</testsuite>
2323
</testsuites>
2424
<filter>
2525
<whitelist>
26-
<directory suffix=".php">../lib/</directory>
26+
<directory suffix=".php">lib/</directory>
2727
</whitelist>
2828
</filter>
2929
</phpunit>

test/Unit/Core/AbstractFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
require_once 'vfsStream/vfsStream.php';
4-
53
use CryptLibTest\Mocks\Core\Factory;
64

5+
use org\bovigo\vfs\vfsStream;
6+
77
class Unit_Core_AbstractFactoryTest extends PHPUnit_Framework_TestCase {
88

99
protected function setUp() {

test/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ function getTestDataFile($file) {
4949
return __DIR__ . '/Data/' . $file;
5050
}
5151

52-
require_once dirname(__DIR__) . '/lib/CryptLib/bootstrap.php';
52+
require_once dirname(__DIR__) . '/vendor/autoload.php';
5353

0 commit comments

Comments
 (0)