diff --git a/04/writing_your_own_validators/protected/models/SiteConfirmation.php b/04/writing_your_own_validators/protected/models/SiteConfirmation.php index 0ec00f7..ade5401 100644 --- a/04/writing_your_own_validators/protected/models/SiteConfirmation.php +++ b/04/writing_your_own_validators/protected/models/SiteConfirmation.php @@ -12,7 +12,7 @@ public function rules() public function confirm($attribute,$params) { $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $this->url); + curl_setopt($ch, CURLOPT_URL, $this->$attribute); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); diff --git a/05/testing_the_application_with_functional_tests/protected/tests/functional/CheckAllWidgetTest.php b/05/testing_the_application_with_functional_tests/protected/tests/functional/CheckAllWidgetTest.php index 3b7cc66..8fae9bf 100644 --- a/05/testing_the_application_with_functional_tests/protected/tests/functional/CheckAllWidgetTest.php +++ b/05/testing_the_application_with_functional_tests/protected/tests/functional/CheckAllWidgetTest.php @@ -1,6 +1,17 @@ setBrowserUrl('http://localhost/test-application'); + } + public function testWidget() { $this->open('check/index'); diff --git a/06/automating_timestamps/protected/controllers/TestController.php b/06/automating_timestamps/protected/controllers/TestController.php index 36d2ad7..aff910f 100644 --- a/06/automating_timestamps/protected/controllers/TestController.php +++ b/06/automating_timestamps/protected/controllers/TestController.php @@ -7,6 +7,11 @@ public function actionIndex() $post->title = "test title"; $post->text = "test text"; $post->save(); - echo date('r', $post->created_on); + + // we need to refresh the model since CTimestampBehavior uses + // CDbExpression to set creation date which has to be evaluated by the database + $post->refresh(); + + echo "Post has been created on " . date('r', $post->created_on); } } \ No newline at end of file