Kohana v3.3.5

This commit is contained in:
Deon George
2016-05-01 20:50:24 +10:00
parent 8888719653
commit 68c7f4f159
170 changed files with 4565 additions and 1176 deletions

View File

@@ -0,0 +1,37 @@
sudo: false
language: php
# Only build the main develop/master branches - feature branches will be covered by PRs
branches:
only:
- /^[0-9\.]+\/(develop|master)$/
cache:
directories:
- vendor
- $HOME/.composer/cache
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
matrix:
include:
- php: 5.3
env: 'COMPOSER_PHPUNIT="lowest"'
before_script:
- composer install --prefer-dist
- if [ "$COMPOSER_PHPUNIT" = "lowest" ]; then composer update --prefer-lowest --with-dependencies phpunit/phpunit; fi;
- vendor/bin/koharness
script:
- cd /tmp/koharness && ./vendor/bin/phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php
notifications:
email: false

View File

@@ -1,5 +1,10 @@
# Minion
| ver | Stable | Develop |
|-------|----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| 3.3.x | [![Build Status - 3.3/master](https://travis-ci.org/kohana/minion.svg?branch=3.3%2Fmaster)](https://travis-ci.org/kohana/minion) | [![Build Status - 3.3/develop](https://travis-ci.org/kohana/minion.svg?branch=3.3%2Fdevelop)](https://travis-ci.org/kohana/minion) |
| 3.4.x | [![Build Status - 3.4/master](https://travis-ci.org/kohana/minion.svg?branch=3.4%2Fmaster)](https://travis-ci.org/kohana/minion) | [![Build Status - 3.4/develop](https://travis-ci.org/kohana/minion.svg?branch=3.4%2Fdevelop)](https://travis-ci.org/kohana/minion) |
Minion is a framework for running tasks via the CLI.
The system is inspired by ruckusing, which had a nice system for defining tasks but lacked the desired flexibility for kohana integration.

View File

@@ -170,7 +170,7 @@ class Kohana_Minion_CLI {
// Create temporary file
file_put_contents($vbscript, 'wscript.echo(InputBox("'.addslashes($text).'"))');
$password = shell_exec('cscript //nologo '.escapeshellarg($text));
$password = shell_exec('cscript //nologo '.escapeshellarg($vbscript));
// Remove temporary file.
unlink($vbscript);
@@ -278,7 +278,7 @@ class Kohana_Minion_CLI {
* @copyright 2010 - 2011 Fuel Development Team
* @link http://fuelphp.com
* @param string $text the text to color
* @param atring $foreground the foreground color
* @param string $foreground the foreground color
* @param string $background the background color
* @return string the color coded string
*/

View File

@@ -1,6 +1,6 @@
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Minipn exception
* Minion exception
*
* @package Kohana
* @category Minion
@@ -15,8 +15,6 @@ class Kohana_Minion_Exception extends Kohana_Exception {
*
* Should this display a stack trace? It's useful.
*
* Should this still log? Maybe not as useful since we'll see the error on the screen.
*
* @uses Kohana_Exception::text
* @param Exception $e
* @return boolean
@@ -25,6 +23,9 @@ class Kohana_Minion_Exception extends Kohana_Exception {
{
try
{
// Log the exception
Kohana_Exception::log($e);
if ($e instanceof Minion_Exception)
{
echo $e->format_for_cli();

View File

@@ -24,10 +24,18 @@
"kohana/core": ">=3.3",
"php": ">=5.3.3"
},
"require-dev": {
"kohana/core": "3.3.*@dev",
"kohana/unittest": "3.3.*@dev",
"kohana/koharness": "*@dev"
},
"extra": {
"branch-alias": {
"dev-3.3/develop": "3.3.x-dev",
"dev-3.4/develop": "3.4.x-dev"
}
},
"installer-paths": {
"vendor/{$vendor}/{$name}": ["type:kohana-module"]
}
}
}

View File

@@ -0,0 +1,8 @@
<?php
// Configuration for koharness - builds a standalone skeleton Kohana app for running unit tests
return array(
'modules' => array(
'minion' => __DIR__,
'unittest' => __DIR__ . '/vendor/kohana/unittest'
),
);

View File

@@ -1,70 +0,0 @@
<?php
/**
* Test case for Minion_Util
*
* @package Kohana/Minion
* @group kohana
* @group kohana.minion
* @category Test
* @author Kohana Team
* @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Minion_TaskTest extends Kohana_Unittest_TestCase
{
/**
* Provides test data for test_convert_task_to_class_name()
*
* @return array
*/
public function provider_convert_task_to_class_name()
{
return array(
array('Task_Db_Migrate', 'db:migrate'),
array('Task_Db_Status', 'db:status'),
array('', ''),
);
}
/**
* Tests that a task can be converted to a class name
*
* @test
* @covers Minion_Task::convert_task_to_class_name
* @dataProvider provider_convert_task_to_class_name
* @param string Expected class name
* @param string Input task name
*/
public function test_convert_task_to_class_name($expected, $task_name)
{
$this->assertSame($expected, Minion_Task::convert_task_to_class_name($task_name));
}
/**
* Provides test data for test_convert_class_to_task()
*
* @return array
*/
public function provider_convert_class_to_task()
{
return array(
array('db:migrate', 'Task_Db_Migrate'),
);
}
/**
* Tests that the task name can be found from a class name / object
*
* @test
* @covers Minion_Task::convert_class_to_task
* @dataProvider provider_convert_class_to_task
* @param string Expected task name
* @param mixed Input class
*/
public function test_convert_class_to_task($expected, $class)
{
$this->assertSame($expected, Minion_Task::convert_class_to_task($class));
}
}