diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 21d57da..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "tools/phptools"] - path = tools/phptools - url = git://github.com/ralphschindler/PHPTools.git diff --git a/.travis/run-tests.sh b/.travis/run-tests.sh deleted file mode 100755 index a84e0ba..0000000 --- a/.travis/run-tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -travisdir=$(dirname "$0") -testdir="$travisdir/../tests" -testedcomponents=(`cat "$travisdir/tested-components"`) -result=0 - -for tested in "${testedcomponents[@]}" - do - echo "$tested:" - phpunit -c $testdir/phpunit.xml.dist $testdir/$tested - result=$(($result || $?)) -done - -exit $result diff --git a/.travis/skipped-components b/.travis/skipped-components deleted file mode 100644 index 171dfe9..0000000 --- a/.travis/skipped-components +++ /dev/null @@ -1,7 +0,0 @@ -Zend/Amf -Zend/Date -Zend/Dojo -Zend/Queue -Zend/Service -Zend/Test -Zend/Wildfire diff --git a/.travis/tested-components b/.travis/tested-components deleted file mode 100644 index b0b9438..0000000 --- a/.travis/tested-components +++ /dev/null @@ -1,61 +0,0 @@ -Zend/Acl -Zend/Authentication -Zend/Barcode -Zend/Cache -Zend/Captcha -Zend/Cloud -Zend/Code -Zend/Config -Zend/Console -Zend/Crypt -Zend/Currency -Zend/Db -Zend/Di -Zend/DocBook -Zend/Dojo -Zend/Dom -Zend/EventManager -Zend/Feed -Zend/File -Zend/Filter -Zend/Form -Zend/GData -Zend/Http -Zend/InfoCard -Zend/InputFilter -Zend/Json -Zend/Ldap -Zend/Loader -Zend/Locale -Zend/Log -Zend/Mail -Zend/Markup -Zend/Math -Zend/Measure -Zend/Memory -Zend/Mime -Zend/ModuleManager -Zend/Mvc -Zend/Navigation -Zend/OAuth -Zend/OpenId -Zend/Paginator -Zend/Pdf -Zend/ProgressBar -Zend/RegistryTest.php -Zend/Rest -Zend/Search -Zend/Serializer -Zend/Server -Zend/Session -Zend/Soap -Zend/Stdlib -Zend/Tag -Zend/Text -Zend/TimeSync -Zend/Translator -Zend/Uri -Zend/Validator -Zend/VersionTest.php -Zend/View -Zend/XmlRpc diff --git a/composer.json b/composer.json index 0c4d74c..1ac9c18 100644 --- a/composer.json +++ b/composer.json @@ -1,28 +1,28 @@ { - "name": "zendframework/zend-progress-bar", - "description": "Zend\\ProgressBar component", + "name": "zendframework/zend-progressbar", + "description": "component to create and update progressbars in different environments", "license": "BSD-3-Clause", "keywords": [ "zf2", - "progress-bar" + "progressbar" ], "autoload": { "psr-4": { - "Zend\\ProgressBar\\": "src/" + "Zend\\ProgressBar": "src/" } }, "require": { - "php": ">=5.3.23" - }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "satooshi/php-coveralls": "dev-master", - "phpunit/PHPUnit": "~4.0" + "php": ">=5.3.3" }, "homepage": "https://github.com/zendframework/zend-progress-bar", "autoload-dev": { "psr-4": { "ZendTest\\ProgressBar\\": "test/" } + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "satooshi/php-coveralls": "dev-master", + "phpunit/PHPUnit": "~4.0" } } \ No newline at end of file diff --git a/src/Adapter/AbstractAdapter.php b/src/Adapter/AbstractAdapter.php index a39e6fd..1157c9c 100644 --- a/src/Adapter/AbstractAdapter.php +++ b/src/Adapter/AbstractAdapter.php @@ -1,21 +1,11 @@ _width = (int) $match[1]; - } else if (preg_match('#columns = (\d+);#', @shell_exec('stty'), $match) === 1) { + } elseif (preg_match('#columns = (\d+);#', @shell_exec('stty'), $match) === 1) { $this->_width = (int) $match[1]; } } diff --git a/src/Adapter/Exception/ExceptionInterface.php b/src/Adapter/Exception/ExceptionInterface.php index ed10605..d8feb3a 100644 --- a/src/Adapter/Exception/ExceptionInterface.php +++ b/src/Adapter/Exception/ExceptionInterface.php @@ -1,21 +1,11 @@ assertContains('foobar [', $adapter->getLastOutput()); } - public function testSetOutputStreamOpen() { + public function testSetOutputStreamOpen() + { $adapter = new Adapter\Console(); $adapter->setOutputStream('zendprogressbaradapterconsole://test1'); $this->assertArrayHasKey('test1', MockupStream::$tests); @@ -237,12 +226,13 @@ public function testSetOutputStreamOpen() { public function testSetOutputStreamOpenFail() { $adapter = new Adapter\Console(); - + $this->setExpectedException('Zend\ProgressBar\Adapter\Exception\RuntimeException', 'Unable to open stream'); $adapter->setOutputStream(null); } - public function testSetOutputStreamReplaceStream() { + public function testSetOutputStreamReplaceStream() + { $adapter = new Adapter\Console(); $adapter->setOutputStream('zendprogressbaradapterconsole://test2'); $this->assertArrayHasKey('test2', MockupStream::$tests); @@ -251,7 +241,8 @@ public function testSetOutputStreamReplaceStream() { $this->assertArrayNotHasKey('test2', MockupStream::$tests); } - public function testgetOutputStream() { + public function testgetOutputStream() + { $adapter = new Adapter\Console(); $adapter->setOutputStream('zendprogressbaradapterconsole://test4'); $resource = $adapter->getOutputStream(); @@ -259,20 +250,23 @@ public function testgetOutputStream() { $this->assertEquals('Hello Word!', MockupStream::$tests['test4']); } - public function testgetOutputStreamReturnigStdout() { + public function testgetOutputStreamReturnigStdout() + { $adapter = new Adapter\Console(); $resource = $adapter->getOutputStream(); $this->assertTrue(is_resource($resource)); } - public function testFinishEol() { + public function testFinishEol() + { $adapter = new Adapter\Console(); $adapter->setOutputStream('zendprogressbaradapterconsole://test5'); $adapter->finish(); $this->assertEquals(PHP_EOL, MockupStream::$tests['test5']); } - public function testFinishNone() { + public function testFinishNone() + { $adapter = new Adapter\Console(); $adapter->setOutputStream('zendprogressbaradapterconsole://test7'); $adapter->setFinishAction(Adapter\Console::FINISH_ACTION_NONE); @@ -283,7 +277,7 @@ public function testFinishNone() { public function testSetBarLeftChar() { $adapter = new Adapter\Console(); - + $this->setExpectedException('Zend\ProgressBar\Adapter\Exception\InvalidArgumentException','Character may not be empty'); $adapter->setBarLeftChar(null); } @@ -291,7 +285,7 @@ public function testSetBarLeftChar() public function testSetBarRightChar() { $adapter = new Adapter\Console(); - + $this->setExpectedException('Zend\ProgressBar\Adapter\Exception\InvalidArgumentException','Character may not be empty'); $adapter->setBarRightChar(null); } @@ -299,7 +293,7 @@ public function testSetBarRightChar() public function testSetInvalidFinishAction() { $adapter = new Adapter\Console(); - + $this->setExpectedException('Zend\ProgressBar\Adapter\Exception\InvalidArgumentException','Invalid finish action specified'); $adapter->setFinishAction('CUSTOM_FINISH_ACTION'); } diff --git a/test/Adapter/JsPullTest.php b/test/Adapter/JsPullTest.php index 95e6743..37ab4de 100644 --- a/test/Adapter/JsPullTest.php +++ b/test/Adapter/JsPullTest.php @@ -1,22 +1,11 @@ test = $url["host"]; @@ -47,14 +34,14 @@ function stream_open($path, $mode, $options, &$opened_path) return true; } - function stream_read($count) + public function stream_read($count) { $ret = substr(self::$tests[$this->test], $this->position, $count); $this->position += strlen($ret); return $ret; } - function stream_write($data) + public function stream_write($data) { $left = substr(self::$tests[$this->test], 0, $this->position); $right = substr(self::$tests[$this->test], $this->position + strlen($data)); @@ -63,17 +50,17 @@ function stream_write($data) return strlen($data); } - function stream_tell() + public function stream_tell() { return $this->position; } - function stream_eof() + public function stream_eof() { return $this->position >= strlen(self::$tests[$this->test]); } - function stream_seek($offset, $whence) + public function stream_seek($offset, $whence) { switch ($whence) { case SEEK_SET: @@ -108,7 +95,8 @@ function stream_seek($offset, $whence) } } - public function __destruct() { + public function __destruct() + { unset(self::$tests[$this->test]); } } diff --git a/test/ProgressBarTest.php b/test/ProgressBarTest.php index 49534c4..1a826af 100644 --- a/test/ProgressBarTest.php +++ b/test/ProgressBarTest.php @@ -1,22 +1,11 @@ setExpectedException('Zend\ProgressBar\Exception\OutOfRangeException', '$max must be greater than $min');