Tagged Questions
1
vote
1answer
30 views
Yii & PHPUnit mocking with fluent/mockbuilder gives weird results
Why is this:
$mock = $this->getMock("EventDispatcher");
$mock->expects($this->once())->method("fireEvent");
Not the same as:
$mock = ...
0
votes
1answer
24 views
Running unit test with the Yii framework
Background
I'm using the Yii framework and have just started creating some unit tests for my project. I am trying to run my test via command line.
$cd www/site/webapp/protected/tests
$phpunit ...
0
votes
1answer
29 views
Selenium phpunit testing without DB
Intro:
I have a Yii webapp which I want to test using phpunit and selenium testing, but here is the catch, I do not use a DB. I communicate with an API which integrates with Yii's activeRecord ...
0
votes
1answer
47 views
Launching PHPUnit in PHPStorm for a single instance
I've seen a lot topics about PhpStorm, but they actually got me more confused than I was before.
Basically, my file structure looks like this:
http://i.stack.imgur.com/1nFE2.png
(This is from the Yii ...
0
votes
1answer
58 views
How do I set method tearDown() in yii with phpunit?
I wrote a class registration and test for it.
$this->open('/');
if($this->isTextPresent('logout'))
$this->clickAndWait('link=logout');
$this->clickAndWait('link=reg');
...
0
votes
1answer
29 views
Yii, CDbTestCase save() fails
I want to test the creation of a group in my application. So I copied the AR-Test of the tutorial and modified it to my needs. I added a fixture and if I call ...::model()->findAll() I get the groups ...
0
votes
1answer
103 views
Yii: Fixtures And Setup() In Unit Test
I hope someone can help me. I installed and tried to use phpunit. It Works well but now i tried to use fixtures and the setUp method and it doesn't work.
class RightGroupTest extends CDbTestCase {
...
1
vote
1answer
66 views
Yii Framework - How to run functional test case in background with phpunit/selenium2
I am developing a application with the functional (with phpunit/selenium2) test case. I have to attached the pre-commit hook to a functional testing. So when ever i try to commit something it opens ...
0
votes
1answer
148 views
Functional testing clickAndWait not working
I am writing web application in yii with the phpunit selenum testing here is my test case for the login form
public function testHasLoginForm()
{
$this->open('site/login');
...
1
vote
2answers
183 views
How to assert the current URL?
I'm unittesting my Yii application with PHPUnit and Selenium-server.
Code:
class StartSurveyRedirectTest extends WebTestCase
{
public $fixtures=array(
'sessions'=>'SurveySession',
...
1
vote
1answer
73 views
phpunit assert that the element has a value
I'm using phpunit for the Yii framework. Tried creating a functional test. How to test that the existing element or label has a value.
I have read that
...
0
votes
1answer
49 views
Yii CDbTestCase findByAttributes is creating a row
I am writing a unit test, and I stumbled upon a very strange behavior.
I have a test fixture so I expect to see 1 row in the database (there is only 1 row listed in the fixture) I wrote some code to ...
2
votes
1answer
97 views
Create a test for widget in yii
I created a widget in Yii to display graphics using the http://www.highcharts.com/ library. My widget works pretty similar as CGridView widget from Yii.
I know that for visual elements I could have a ...
1
vote
1answer
129 views
PHPUnit deletes database records for Yii unit testing
I am running unit tests in Yii using phpunit. All tests are passing, but it leaves me with one record in the database when I expected to see three, one for the fixture when testing login and two from ...
1
vote
2answers
112 views
how to assert Yii log messages in a phpunit
Yii has logging system built. In certain case I want to make sure that logging is done properly, i.e. correct message is getting logged as "error" or "warning".
How can I read these messages from ...