Skip to content

Instantly share code, notes, and snippets.

@mageekguy
mageekguy / gist:1134264
Created August 9, 2011 14:56
classes/asserters/phpClass.php
?php
namespace mageekguy\atoum\asserters;
use
mageekguy\atoum,
mageekguy\atoum\exceptions
;
class phpClass extends atoum\asserter
@mageekguy
mageekguy / gist:1134270
Created August 9, 2011 14:57
tests/units/classes/asserters/phpClass.php
<?php
namespace mageekguy\atoum\tests\units\asserters;
use
mageekguy\atoum,
mageekguy\atoum\asserter,
mageekguy\atoum\asserters
;
error:_sahi.setServerVarPlain('___lastValue___4ee8544aa88a8', _byXPath("(//html/.//*[self::input | self::textarea | self::select][not(./@type = 'submit ' or ./@type = 'image' or ./@type = 'hidden')][(((./@id = 'Model_User_login' or ./@name = 'Model_User_login') or ./@id = //label[contains(normalize-space(str ing(.)), 'Model_User_login')]/@for) or ./@placeholder = 'Model_User_login')] | .//label[contains(normalize-space(string(.)), 'Model_User_login')]//.//*[self: :input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')])[1]").getAttribute("type"))
TypeError: Cet objet ne gère pas cette propriété ou cette méthode
No trace available
<a href='/_s_/dyn/Log_getBrowserScript?href=null&n=-1'><b>Click for browser script</b></a
public function getPhpPath()
{
if ($this->phpPath === null)
{
if (isset($this->superglobals->_SERVER['_']) === true)
{
$this->setPhpPath($this->superglobals->_SERVER['_']);
}
else
{
((//html//table/caption[normalize-space(.) = 'Thirds -
person']/..)[1]//tbody/tr[td[normalize-space(.) =
'a_test']])[1]//td//a[normalize-space(.) = 'Activate'][contains(concat('
',normalize-space(@class),' '),' active ')]
<?php
namespace vendor\project\mytestunit\foo;
use mageekguy\atoum;
/**
* @namespace mytestunit
*/
class foo extends atoum\test // test class vendor\project\foo
public function testExecute()
{
$socket = $this->getMockBuilder('socket')
->disableOriginalConstructor()
->getMock()
;
$socket->expects($this->once())
->method('write')
->with(
public function testExecute()
{
$this
->if->mockGenerator->shunt('__construct')
->and->mockGenerator->shunt('write')
->and((new command($socket = new \mock\socket()))->execute())
->then
->mock($socket)
->call('write')
->withArguments('vc', array(00, 0x01), 6)
public function testExecute()
{
$this->mockGenerator->shunt('__construct');
$socket = new \mock\socket();
$socket->getMockController()->write = function() {};
new command($socket))->execute();
$this->mock($socket)
public function test__construct_which_should_accept_event_dispatcher_as_an_argument()
{
$this
->if($dispatcher = new \mock\Symfony\Component\EventDispatcher\EventDispatcherInterface())
->and($runner = new PHPSpectZ\Runner($dispatcher))
->then
->object($runner->getEventDispatcher())->isIdenticalTo($dispatcher)
;
// work fine too