Skip to content

Instantly share code, notes, and snippets.

@mageekguy
mageekguy / gist:1134264
Created Aug 9, 2011
classes/asserters/phpClass.php
View gist:1134264
?php
namespace mageekguy\atoum\asserters;
use
mageekguy\atoum,
mageekguy\atoum\exceptions
;
class phpClass extends atoum\asserter
@mageekguy
mageekguy / gist:1134270
Created Aug 9, 2011
tests/units/classes/asserters/phpClass.php
View gist:1134270
<?php
namespace mageekguy\atoum\tests\units\asserters;
use
mageekguy\atoum,
mageekguy\atoum\asserter,
mageekguy\atoum\asserters
;
View gist:1475842
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
View gist:1476560
public function getPhpPath()
{
if ($this->phpPath === null)
{
if (isset($this->superglobals->_SERVER['_']) === true)
{
$this->setPhpPath($this->superglobals->_SERVER['_']);
}
else
{
View gist:1884102
((//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 ')]
View gist:2028610
<?php
namespace vendor\project\mytestunit\foo;
use mageekguy\atoum;
/**
* @namespace mytestunit
*/
class foo extends atoum\test // test class vendor\project\foo
View gist:2251561
public function testExecute()
{
$socket = $this->getMockBuilder('socket')
->disableOriginalConstructor()
->getMock()
;
$socket->expects($this->once())
->method('write')
->with(
View gist:2251563
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)
View gist:2255009
public function testExecute()
{
$this->mockGenerator->shunt('__construct');
$socket = new \mock\socket();
$socket->getMockController()->write = function() {};
new command($socket))->execute();
$this->mock($socket)
View gist:3089522
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