Just starting out in Yii, not entirely sure if the issue is with me. I have been making my way through the AWDWY book and following the create a blog tutorial using 1.1.6. Now I am starting on my own webapp, and upgraded to 1.1.7.
I created a new webapp with Yii 1.1.7 and configured phpunit & selenium how I thought it should be done and ran phpunit functional/SiteTest.php to make sure all was good. It stops when trying to save a post without a body - even though "Body cannot be blank." does appear in the browser. Eventually the test times out (the browser does open and go to the right pages). I check and rechecked the settings and they seem ok.
After spending several hours checking settings, googling I finally gave up and created another webapp using 1.1.6. I configured phpunit & selenium exactly the same way and the tests pass without stumbling. Is this a know problem? Both instances are using freshly generated webapps.
System:
Ubuntu 10.10
PHP:
PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 16:07:38)
Copyright © 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2010 Zend Technologies
with Xdebug v2.1.2dev, Copyright (c) 2002-2011, by Derick Rethans
Firefox 4
Yii 1.1.6 - tests pass
Yii 1.1.7 - tests fail
bootstrap.php (1.1.7):
<?php
// change the following paths if necessary
$yiit=dirname(__FILE__).'/../../../../yii-117/framework/yiit.php';
$config=dirname(__FILE__).'/../config/test.php';
require_once($yiit);
require_once(dirname(__FILE__).'/WebTestCase.php');
Yii::createWebApplication($config);
bootstrap.php (1.1.6):
<?php
// change the following paths if necessary
$yiit=dirname(__FILE__).'/../../../../yii-116/framework/yiit.php';
$config=dirname(__FILE__).'/../config/test.php';
require_once($yiit);
require_once(dirname(__FILE__).'/WebTestCase.php');
Yii::createWebApplication($config);
WebTestCase.php:
<?php
/**
* Change the following URL based on your server configuration
* Make sure the URL ends with a slash so that we can use relative URLs in test cases
*/
define('TEST_BASE_URL','');
/**
* The base class for functional test cases.
* In this class, we set the base URL for the test application.
* We also provide some common methods to be used by concrete test classes.
*/
class WebTestCase extends CWebTestCase
{
/**
* Sets up before each test method runs.
* This mainly sets the base URL for the test application.
*/
protected function setUp()
{
parent::setUp();
$this->setBrowserUrl(TEST_BASE_URL);
}
}
phpunit.xml:
<phpunit bootstrap="bootstrap.php"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<selenium>
<!-- <browser name="Internet Explorer" browser="*iexplore" /> -->
<browser name="Firefox" browser="*custom /usr/lib/firefox-4.0/firefox.sh -p Selenium" />
</selenium>
</phpunit>
(as this is my first post, I cannot put a url in here, but there is a correct URL in WebTestCase.php)