Skip to content

Commit

Permalink
Merge pull request #497 from vjnrv/master
Browse files Browse the repository at this point in the history
Added support for command 'doctrine:mongodb:fixtures:load'
  • Loading branch information
willdurand committed May 16, 2014
2 parents a1009a1 + c4eb533 commit 821b6bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/symfony2/doctrine.rb
Expand Up @@ -159,6 +159,14 @@
end
end
end

desc "Load data fixtures"
task :load_fixtures, :roles => :app, :except => { :no_release => true } do
if !interactive_mode || Capistrano::CLI.ui.agree("Careful, database will be purged. Do you want to continue? (Y/N)")
run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:mongodb:fixtures:load --no-interaction #{console_options}'", :once => true
end
capifony_puts_ok
end
end

namespace :init do
Expand Down
12 changes: 12 additions & 0 deletions spec/capifony_symfony2_doctrine_spec.rb
Expand Up @@ -172,6 +172,18 @@
it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:mongodb:schema:drop --index --env=prod --no-debug\'') }
end

it "defines symfony:doctrine:mongodb:load_fixtures task" do
@configuration.find_task('symfony:doctrine:mongodb:load_fixtures').should_not == nil
end

context "when running symfony:doctrine:mongodb:load_fixtures" do
before do
@configuration.find_and_execute_task('symfony:doctrine:mongodb:load_fixtures')
end

it { should have_run(' sh -c \'cd /var/www/releases/20120927 && php app/console doctrine:mongodb:fixtures:load --no-interaction --env=prod --no-debug\'') }
end

it "defines symfony:doctrine:init tasks" do
@configuration.find_task('symfony:doctrine:init:acl').should_not == nil
end
Expand Down

0 comments on commit 821b6bf

Please sign in to comment.