Author: maksim_ka
Date: 2010-02-15 20:43:15 +0100 (Mon, 15 Feb 2010)
New Revision: 28044
Modified:
plugins/sfPhpunitPlugin/branches/1.2/data/unit/BasePhpunitTestSuite.tpl
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitDoctrineData.php
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitPropelData.php
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfBasePhpunitTestSuite.class.php
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitSeleniumTestCase.php
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitTestCase.class.php
Log:
[sfPhpunitPlugin][sf1.2]
- selenium autocomplite methods
- base testcase\testsuite don't implement fixtureagregator interface by
default.
- fixture throws exception if the requested fixture data object is not exist.
- all test can be run through standart phpunit command. like: `$ phpunit
test/phpunit/BasePhpunitTestSuite.php`
Modified:
plugins/sfPhpunitPlugin/branches/1.2/data/unit/BasePhpunitTestSuite.tpl
===================================================================
--- plugins/sfPhpunitPlugin/branches/1.2/data/unit/BasePhpunitTestSuite.tpl
2010-02-15 18:51:06 UTC (rev 28043)
+++ plugins/sfPhpunitPlugin/branches/1.2/data/unit/BasePhpunitTestSuite.tpl
2010-02-15 19:43:15 UTC (rev 28044)
@@ -1,5 +1,14 @@
<?php
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+require_once 'PHPUnit/TextUI/Command.php';
+
+require_once dirname(__FILE__).'/../../config/ProjectConfiguration.class.php';
+require_once
dirname(__FILE__).'/../../plugins/sfPhpunitPlugin/lib/test/sfBasePhpunitTestSuite.class.php';
+require_once
dirname(__FILE__).'/../../plugins/sfPhpunitPlugin/lib/test/sfPhpunitContextInitilizerInterface.php';
+
+
class {className} extends sfBasePhpunitTestSuite
implements sfPhpunitContextInitilizerInterface
{
@@ -8,8 +17,6 @@
*/
protected function _start()
{
- $this->_setupContext();
- //$this->_setupDatabaseSchema();
}
/**
@@ -23,4 +30,13 @@
{
return '{application}';
}
+
+ public static function suite()
+ {
+ ///init context
+ $suite = new self();
+ $suite->setupContext();
+
+ return sfPhpunitSuiteLoader::factory()->getSuite();
+ }
}
\ No newline at end of file
Modified:
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitDoctrineData.php
===================================================================
---
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitDoctrineData.php
2010-02-15 18:51:06 UTC (rev 28043)
+++
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitDoctrineData.php
2010-02-15 19:43:15 UTC (rev 28044)
@@ -14,8 +14,12 @@
list($table, $id) = explode('_', $id, 2);
$id = '('.strtolower($table).') '.strtolower($id);
-
- return isset($this->_importedObjects[$id]) ?
$this->_importedObjects[$id] : null;
+
+ if (!isset($this->_importedObjects[$id])) {
+ throw new Exception('The data object with given id `'.$id.'` does not
exist');
+ }
+
+ return $this->_importedObjects[$id];
}
public function cleanObjects()
Modified:
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitPropelData.php
===================================================================
---
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitPropelData.php
2010-02-15 18:51:06 UTC (rev 28043)
+++
plugins/sfPhpunitPlugin/branches/1.2/lib/fixture/data/sfPhpunitPropelData.php
2010-02-15 19:43:15 UTC (rev 28044)
@@ -11,8 +11,12 @@
if (strpos($id, '_') === false) {
throw new Exception('The id should match the pattern {class}_{id} but
you provide: `'.$id.'`');
}
+
+ if (!isset($this->object_references[$id])) {
+ throw new Exception('The data object with given id `'.$id.'` does not
exist');
+ }
- return isset($this->object_references[$id]) ?
$this->object_references[$id] : null;
+ return $this->object_references[$id];
}
public function cleanObjects()
Modified:
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfBasePhpunitTestSuite.class.php
===================================================================
---
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfBasePhpunitTestSuite.class.php
2010-02-15 18:51:06 UTC (rev 28043)
+++
plugins/sfPhpunitPlugin/branches/1.2/lib/test/sfBasePhpunitTestSuite.class.php
2010-02-15 19:43:15 UTC (rev 28044)
@@ -10,7 +10,6 @@
*/
class sfBasePhpunitTestSuite
extends PHPUnit_Framework_TestSuite
- implements sfPhpunitFixtureAggregator
{
/**
*
Modified:
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitSeleniumTestCase.php
===================================================================
---
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitSeleniumTestCase.php
2010-02-15 18:51:06 UTC (rev 28043)
+++
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitSeleniumTestCase.php
2010-02-15 19:43:15 UTC (rev 28044)
@@ -1,10 +1,230 @@
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
-
+
+ /**
+ * Delegate method calls to the driver.
+ *
+ * @param string $command
+ * @param array $arguments
+ * @return mixed
+ * @method unknown addLocationStrategy()
+ * @method unknown addLocationStrategyAndWait()
+ * @method unknown addScript()
+ * @method unknown addScriptAndWait()
+ * @method unknown addSelection()
+ * @method unknown addSelectionAndWait()
+ * @method unknown allowNativeXpath()
+ * @method unknown allowNativeXpathAndWait()
+ * @method unknown altKeyDown()
+ * @method unknown altKeyDownAndWait()
+ * @method unknown altKeyUp()
+ * @method unknown altKeyUpAndWait()
+ * @method unknown answerOnNextPrompt()
+ * @method unknown assignId()
+ * @method unknown assignIdAndWait()
+ * @method unknown attachFile()
+ * @method unknown break()
+ * @method unknown captureEntirePageScreenshot()
+ * @method unknown captureEntirePageScreenshotAndWait()
+ * @method unknown captureEntirePageScreenshotToStringAndWait()
+ * @method unknown captureScreenshotAndWait()
+ * @method unknown captureScreenshotToStringAndWait()
+ * @method unknown check()
+ * @method unknown checkAndWait()
+ * @method unknown chooseCancelOnNextConfirmation()
+ * @method unknown chooseCancelOnNextConfirmationAndWait()
+ * @method unknown chooseOkOnNextConfirmation()
+ * @method unknown chooseOkOnNextConfirmationAndWait()
+ * @method unknown click()
+ * @method unknown clickAndWait()
+ * @method unknown clickAt()
+ * @method unknown clickAtAndWait()
+ * @method unknown close()
+ * @method unknown contextMenu()
+ * @method unknown contextMenuAndWait()
+ * @method unknown contextMenuAt()
+ * @method unknown contextMenuAtAndWait()
+ * @method unknown controlKeyDown()
+ * @method unknown controlKeyDownAndWait()
+ * @method unknown controlKeyUp()
+ * @method unknown controlKeyUpAndWait()
+ * @method unknown createCookie()
+ * @method unknown createCookieAndWait()
+ * @method unknown deleteAllVisibleCookies()
+ * @method unknown deleteAllVisibleCookiesAndWait()
+ * @method unknown deleteCookie()
+ * @method unknown deleteCookieAndWait()
+ * @method unknown deselectPopUp()
+ * @method unknown deselectPopUpAndWait()
+ * @method unknown doubleClick()
+ * @method unknown doubleClickAndWait()
+ * @method unknown doubleClickAt()
+ * @method unknown doubleClickAtAndWait()
+ * @method unknown dragAndDrop()
+ * @method unknown dragAndDropAndWait()
+ * @method unknown dragAndDropToObject()
+ * @method unknown dragAndDropToObjectAndWait()
+ * @method unknown dragDrop()
+ * @method unknown dragDropAndWait()
+ * @method unknown echo()
+ * @method unknown fireEvent()
+ * @method unknown fireEventAndWait()
+ * @method unknown focus()
+ * @method unknown focusAndWait()
+ * @method string getAlert()
+ * @method array getAllButtons()
+ * @method array getAllFields()
+ * @method array getAllLinks()
+ * @method array getAllWindowIds()
+ * @method array getAllWindowNames()
+ * @method array getAllWindowTitles()
+ * @method string getAttribute()
+ * @method array getAttributeFromAllWindows()
+ * @method string getBodyText()
+ * @method string getConfirmation()
+ * @method string getCookie()
+ * @method string getCookieByName()
+ * @method integer getCursorPosition()
+ * @method integer getElementHeight()
+ * @method integer getElementIndex()
+ * @method integer getElementPositionLeft()
+ * @method integer getElementPositionTop()
+ * @method integer getElementWidth()
+ * @method string getEval()
+ * @method string getExpression()
+ * @method string getHtmlSource()
+ * @method string getLocation()
+ * @method string getLogMessages()
+ * @method integer getMouseSpeed()
+ * @method string getPrompt()
+ * @method array getSelectOptions()
+ * @method string getSelectedId()
+ * @method array getSelectedIds()
+ * @method string getSelectedIndex()
+ * @method array getSelectedIndexes()
+ * @method string getSelectedLabel()
+ * @method array getSelectedLabels()
+ * @method string getSelectedValue()
+ * @method array getSelectedValues()
+ * @method unknown getSpeed()
+ * @method unknown getSpeedAndWait()
+ * @method string getTable()
+ * @method string getText()
+ * @method string getTitle()
+ * @method string getValue()
+ * @method boolean getWhetherThisFrameMatchFrameExpression()
+ * @method boolean getWhetherThisWindowMatchWindowExpression()
+ * @method integer getXpathCount()
+ * @method unknown goBack()
+ * @method unknown goBackAndWait()
+ * @method unknown highlight()
+ * @method unknown highlightAndWait()
+ * @method unknown ignoreAttributesWithoutValue()
+ * @method unknown ignoreAttributesWithoutValueAndWait()
+ * @method boolean isAlertPresent()
+ * @method boolean isChecked()
+ * @method boolean isConfirmationPresent()
+ * @method boolean isCookiePresent()
+ * @method boolean isEditable()
+ * @method boolean isElementPresent()
+ * @method boolean isOrdered()
+ * @method boolean isPromptPresent()
+ * @method boolean isSomethingSelected()
+ * @method boolean isTextPresent()
+ * @method boolean isVisible()
+ * @method unknown keyDown()
+ * @method unknown keyDownAndWait()
+ * @method unknown keyDownNative()
+ * @method unknown keyDownNativeAndWait()
+ * @method unknown keyPress()
+ * @method unknown keyPressAndWait()
+ * @method unknown keyPressNative()
+ * @method unknown keyPressNativeAndWait()
+ * @method unknown keyUp()
+ * @method unknown keyUpAndWait()
+ * @method unknown keyUpNative()
+ * @method unknown keyUpNativeAndWait()
+ * @method unknown metaKeyDown()
+ * @method unknown metaKeyDownAndWait()
+ * @method unknown metaKeyUp()
+ * @method unknown metaKeyUpAndWait()
+ * @method unknown mouseDown()
+ * @method unknown mouseDownAndWait()
+ * @method unknown mouseDownAt()
+ * @method unknown mouseDownAtAndWait()
+ * @method unknown mouseMove()
+ * @method unknown mouseMoveAndWait()
+ * @method unknown mouseMoveAt()
+ * @method unknown mouseMoveAtAndWait()
+ * @method unknown mouseOut()
+ * @method unknown mouseOutAndWait()
+ * @method unknown mouseOver()
+ * @method unknown mouseOverAndWait()
+ * @method unknown mouseUp()
+ * @method unknown mouseUpAndWait()
+ * @method unknown mouseUpAt()
+ * @method unknown mouseUpAtAndWait()
+ * @method unknown mouseUpRight()
+ * @method unknown mouseUpRightAndWait()
+ * @method unknown mouseUpRightAt()
+ * @method unknown mouseUpRightAtAndWait()
+ * @method unknown open()
+ * @method unknown openWindow()
+ * @method unknown openWindowAndWait()
+ * @method unknown pause()
+ * @method unknown refresh()
+ * @method unknown refreshAndWait()
+ * @method unknown removeAllSelections()
+ * @method unknown removeAllSelectionsAndWait()
+ * @method unknown removeScript()
+ * @method unknown removeScriptAndWait()
+ * @method unknown removeSelection()
+ * @method unknown removeSelectionAndWait()
+ * @method unknown retrieveLastRemoteControlLogs()
+ * @method unknown rollup()
+ * @method unknown rollupAndWait()
+ * @method unknown runScript()
+ * @method unknown runScriptAndWait()
+ * @method unknown select()
+ * @method unknown selectAndWait()
+ * @method unknown selectFrame()
+ * @method unknown selectPopUp()
+ * @method unknown selectPopUpAndWait()
+ * @method unknown selectWindow()
+ * @method unknown setBrowserLogLevel()
+ * @method unknown setBrowserLogLevelAndWait()
+ * @method unknown setContext()
+ * @method unknown setCursorPosition()
+ * @method unknown setCursorPositionAndWait()
+ * @method unknown setMouseSpeed()
+ * @method unknown setMouseSpeedAndWait()
+ * @method unknown setSpeed()
+ * @method unknown setSpeedAndWait()
+ * @method unknown shiftKeyDown()
+ * @method unknown shiftKeyDownAndWait()
+ * @method unknown shiftKeyUp()
+ * @method unknown shiftKeyUpAndWait()
+ * @method unknown shutDownSeleniumServer()
+ * @method unknown store()
+ * @method unknown submit()
+ * @method unknown submitAndWait()
+ * @method unknown type()
+ * @method unknown typeAndWait()
+ * @method unknown typeKeys()
+ * @method unknown typeKeysAndWait()
+ * @method unknown uncheck()
+ * @method unknown uncheckAndWait()
+ * @method unknown useXpathLibrary()
+ * @method unknown useXpathLibraryAndWait()
+ * @method unknown waitForCondition()
+ * @method unknown waitForPageToLoad()
+ * @method unknown waitForPopUp()
+ * @method unknown windowFocus()
+ * @method unknown windowMaximize()
+ */
abstract class sfBasePhpunitSeleniumTestCase
extends PHPUnit_Extensions_SeleniumTestCase
- implements sfPhpunitFixtureAggregator
{
/**
*
Modified:
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitTestCase.class.php
===================================================================
---
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitTestCase.class.php
2010-02-15 18:51:06 UTC (rev 28043)
+++
plugins/sfPhpunitPlugin/branches/1.2/lib/testcase/sfBasePhpunitTestCase.class.php
2010-02-15 19:43:15 UTC (rev 28044)
@@ -10,7 +10,6 @@
*/
abstract class sfBasePhpunitTestCase
extends PHPUnit_Framework_TestCase
- implements sfPhpunitFixtureAggregator
{
/**
*
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.