下のソースコードですが、理解できません。
1,2,3,4の部分ですが、setMethodでPOSTメソッドを設定し、そのPOSTの中身はarrayの'username' => 'foobar','password' => 'foobar'ということで合っていますか。requestをつける意味はなんですか。
5,6は、なぜ書いてあるのですか。
7,8ですが、setMethodでGETを設定しているのにsetPOSTになっているのはなぜですか。
質問ばかりですみません。
もしかしたら検索の仕方が悪いのかもしれません。
教えてもらえるとうれしいです。
php
1public function testValidLoginShouldGoToProfilePage() 2 { 3 1 $this->request->setMethod('POST') 4 2 ->setPost(array( 5 3 'username' => 'foobar', 6 4 'password' => 'foobar' 7 )); 8 $this->dispatch('/user/login'); 9 $this->assertRedirectTo('/user/view'); 10 11 5 $this->resetRequest() 12 6 ->resetResponse(); 13 14 7 $this->request->setMethod('GET') 15 8 ->setPost(array()); 16 } 17 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/08/06 15:14
2015/08/06 16:00