From 57925465fe9b1eb8d03552fd776ef70c7f078c43 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 18 Jan 2012 09:33:41 -0600 Subject: [PATCH] added tests_path constant and added tests to bundle publisher. --- laravel/cli/tasks/bundle/publisher.php | 11 +++++++---- paths.php | 9 +++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/laravel/cli/tasks/bundle/publisher.php b/laravel/cli/tasks/bundle/publisher.php index ef7eeeb9..5df2afb1 100644 --- a/laravel/cli/tasks/bundle/publisher.php +++ b/laravel/cli/tasks/bundle/publisher.php @@ -14,20 +14,23 @@ class Publisher { */ public function publish($bundle) { - $this->move($bundle, $this->from($bundle), $this->to($bundle)); + $path = Bundle::path($bundle); - echo "Assets published for bundle [$bundle].".PHP_EOL; + $this->move($path.'public', PUBLIC_PATH.'bundles'.DS.$bundle); + + $this->move($path.'tests', TESTS_PATH.'cases'.DS.'bundles'.DS.$bundle); + + echo "Assets and tests published for bundle [$bundle].".PHP_EOL; } /** * Copy the contents of a bundle's assets to the public folder. * - * @param string $bundle * @param string $source * @param string $destination * @return void */ - protected function move($bundle, $source, $destination) + protected function move($source, $destination) { File::copy_dir($source, $destination); } diff --git a/paths.php b/paths.php index ee6aa7d4..c7fd88a8 100644 --- a/paths.php +++ b/paths.php @@ -23,6 +23,11 @@ // -------------------------------------------------------------- $paths['APP_PATH'] = 'application'; +// -------------------------------------------------------------- +// The path to the Laravel directory. +// -------------------------------------------------------------- +$paths['SYS_PATH'] = 'laravel'; + // -------------------------------------------------------------- // The path to the bundles directory. // -------------------------------------------------------------- @@ -34,9 +39,9 @@ $paths['STORAGE_PATH'] = 'storage'; // -------------------------------------------------------------- -// The path to the Laravel directory. +// The path to the tests directory. // -------------------------------------------------------------- -$paths['SYS_PATH'] = 'laravel'; +$paths['TESTS_PATH'] = 'tests'; // -------------------------------------------------------------- // The path to the public directory.