Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CakePHP2+BDD Pluginを使ってみよう!

Kaz Watanabe
February 14, 2013

CakePHP2+BDD Pluginを使ってみよう!

Kaz Watanabe

February 14, 2013
Tweet

More Decks by Kaz Watanabe

Other Decks in Technology

Transcript

  1. who? • Θͨͳ΂͔ͣͻΖ(@kaz_29) • ϑϦʔϥϯε(decr.jp) • Webܥͷ։ൃ • ΞϓϦ͔ΒΠϯϑϥ·Ͱ... •

    iPhone/iPadΞϓϦ։ൃ • NiftyCloudϢʔβʔϒϩά #iphonedev #cakephp #golf #cat #beer 13೥2݄14೔໦༵೔
  2. #  language:  ja ϑΟʔνϟ:  ϒϩάͷهࣄΛӾཡ͍ͨ͠    ͳͥͳΒϒϩάͷهࣄΛӾཡ͢Δ͜ͱͰɺ࠷৽ͷ৘ใΛೖख͍͔ͨ͠Βͩ      എܠ:

           લఏ  ϒϩάهࣄʹҎԼͷ಺༰͕ొ࿥͞Ε͍ͯΔ͜ͱ:            |  λΠτϧ  |  ຊจ  |            |  λΠτϧ  |  ͜Ε͸ɺهࣄͷຊจͰ͢ɻ  |            |  ·ͨλΠτϧ  |  ͦ͜ʹຊจ͕ଓ͖·͢ɻ  |            |  Title  strikes  back  |  ͜ΓΌຊ౰ʹΘ͘Θ͘͢Δʂ͏ͦɻ  |    γφϦΦ:  هࣄҰཡΛӾཡͰ͖Δ͜ͱ        લఏ  "τοϓϖʔδ"  Λද͍ࣔͯ͠Δ        ͳΒ͹  "λΠτϧ"  ͱදࣔ͞Ε͍ͯΔ͜ͱ        ͔ͭ  "·ͨλΠτϧ"  ͱදࣔ͞Ε͍ͯΔ͜ͱ        ͔ͭ  "Title  strikes  back"  ͱදࣔ͞Ε͍ͯΔ͜ͱ BDD Plugin αϯϓϧΑΓ ϑΟʔνϟ γφϦΦ εςοϓ 13೥2݄14೔໦༵೔
  3. Functions • Spec (Spec for PHP) • CakePHPͷfixture͕࢖͑Δ • ࠷ۙίʔυΧόϨοδΛऔΕΔ༷ʹͳͬͨ

    • Story (Behat) • CakePHP༻ͷDB࿈ܞػೳ(truncateModel/getModel) • URLͷaliasػೳ • Other • URLͷΤΠϦΞεػೳ(ετʔϦͷՄಡੑ޲্ͷͨΊʣ 13೥2݄14೔໦༵೔
  4. Install $ git submodule add https://github.com/sizuhiko/Bdd.git plugins/Bdd $ cd plgins/Bdd

    $ curl -s https://getcomposer.org/installer | php $ php composer.phar install --dev $ ./app/Console/cake Bdd.init BDD Plugin ೖΕΔ ϥΠϒϥϦ܈ೖΕΔ (composer) ͻͳܗΛࣗಈੜ੒ 13೥2݄14೔໦༵೔
  5. ՝୊ • όϥϯε • ίϯτϩʔϥͷςετ/डೖΕςετ • Ͳ͜·Ͱςετॻ͘ʁ • ͕ͬͭΓJavaScript࢖ͬͯΔͱ΍ͬͺΓॻ͖ ʹ͍͘

    • ϒϥ΢βຖͷλΠϛϯάௐ੔ • डೖΕςετ੒ޭͰࣗಈσϓϩΠ • UnitTest or Spec? 13೥2݄14೔໦༵೔