symfony1.2でDoctrine1.1使ってJobeetチュートリアル11日目

Formもテストしよう回。

Submitting a Form

clickシミュレート後のモジュール、アクションのチェックだからwithの位置は

$browser->info('3 - Post a Job page')->
  info('  3.1 - Submit a Job')->

  get('/job/new')->
  with('request')->begin()->
    isParameter('module', 'job')->
    isParameter('action', 'new')->
  end()->

  click('Preview your job', array('job' => array(
    'company'      => 'Sensio Labs',
    'url'          => 'http://www.sensio.com/',
    'logo'         => sfConfig::get('sf_upload_dir') . 'jobs/sensio-labs.gif',
    'position'     => 'Developer',
    'location'     => 'Atlenta, USA',
    'description'  => 'You will work with symfony to develop websites for our customers.',
    'how_to_apply' => 'Send me a email',
    'email'        => 'for.a.job@example.com',
    'is_public'    => false
  )))->
  with('request')->begin()->
    isParameter('module', 'job')->
    isParameter('action', 'create')->
  end()
;

こうだろ。
最後のjob/createなのかチェックの挿入位置がわかりにくかった。

The Form Tester

間違い

  with('request')->begin()->
    isParameter('module', 'job')->
    isParameter('action', 'create')->
  with('form')->begin()->
    hasErrors(false)->
  end()

正解

  with('request')->begin()->
    isParameter('module', 'job')->
    isParameter('action', 'create')->
  end()->
  with('form')->begin()->
    hasErrors(false)->
  end()

with文を繋げる場合は、endで一回閉じないと怒られる。

The Doctrine Tester


sfTesterDoctrine無いし

cd plugins
svn co http://svn.symfony-project.com/branches/1.2/lib/plugins/sfDoctrinePlugin

brancheからsfDoctrinePluginの最新版もらってきて対処しました。