本文整理汇总了PHP中PHPUnit_Framework_Assert::readAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::readAttribute方法的具体用法?PHP PHPUnit_Framework_Assert::readAttribute怎么用?PHP PHPUnit_Framework_Assert::readAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::readAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_applies_the_requested_relationship_to_the_query
/**
* @test
*/
public function it_applies_the_requested_relationship_to_the_query()
{
/** @var ModelStub $model */
$model = reader::readAttribute($this->repo, 'model');
$this->repo->with('all')->getAll();
$this->assertEquals(['author', 'comments'], $model->getRequestedRelationships());
}
示例2: testSetup
public function testSetup()
{
$app = $this->getApp();
$tr = new TranslationFile($app, 'translations', 'en_GB');
$this->assertEquals('translations', \PHPUnit_Framework_Assert::readAttribute($tr, 'domain'));
$this->assertEquals('en_GB', \PHPUnit_Framework_Assert::readAttribute($tr, 'locale'));
}
示例3: testWhenInputIsSentToTheConstructorThenInitializeUsingTheInput
/**
* when input is sent to the constructor then initialize using the input
*/
public function testWhenInputIsSentToTheConstructorThenInitializeUsingTheInput()
{
$input = array('a' => 'b', 'c' => 'd');
$Collection = new \MySQLExtractor\Common\Collection($input);
$elements = \PHPUnit_Framework_Assert::readAttribute($Collection, 'elements');
$this->assertEquals($input, $elements);
}
示例4: testAdd
public function testAdd()
{
$factory = new WidgetFactory();
$widget1 = \Mockery::mock('CSBill\\DashboardBundle\\Widgets\\WidgetInterface');
$widget2 = \Mockery::mock('CSBill\\DashboardBundle\\Widgets\\WidgetInterface');
$widget3 = \Mockery::mock('CSBill\\DashboardBundle\\Widgets\\WidgetInterface');
$widget4 = \Mockery::mock('CSBill\\DashboardBundle\\Widgets\\WidgetInterface');
$widget5 = \Mockery::mock('CSBill\\DashboardBundle\\Widgets\\WidgetInterface');
$factory->add($widget1, 'top', 100);
$factory->add($widget2, 'left_column', 200);
$factory->add($widget3, 'right_column', 300);
$factory->add($widget4, null, 400);
$factory->add($widget5, 'left_column');
$property = \PHPUnit_Framework_Assert::readAttribute($factory, 'queues');
$this->assertTrue(is_array($property));
$this->assertArrayHasKey('top', $property);
$this->assertArrayHasKey('left_column', $property);
$this->assertArrayHasKey('right_column', $property);
$this->assertInstanceOf('SplPriorityQueue', $property['top']);
$this->assertInstanceOf('SplPriorityQueue', $property['left_column']);
$this->assertInstanceOf('SplPriorityQueue', $property['right_column']);
$this->assertCount(2, $property['top']);
$this->assertCount(2, $property['left_column']);
$this->assertCount(1, $property['right_column']);
}
示例5: testCustomConfigurationPassed
public function testCustomConfigurationPassed()
{
$configuration = new GenericConfiguration();
$configuration->setLocale('nl-be')->setClientName('test')->setRequest(new Request());
$request = RequestFactory::createRequest($configuration);
$this->assertSame($configuration, \PHPUnit_Framework_Assert::readAttribute($request, 'configuration'));
}
示例6: testNamespaces
public function testNamespaces()
{
$this->converter->addNamespace('http://www.example.com', 'some\\php\\ns');
$namespaces = \PHPUnit_Framework_Assert::readAttribute($this->converter, 'namespaces');
$this->assertArrayHasKey('http://www.example.com', $namespaces);
$this->assertEquals('some\\php\\ns', $namespaces['http://www.example.com']);
}
示例7: testTimeoutProperty
public function testTimeoutProperty()
{
$webshot = new Webshot();
$this->assertEquals(30, PHPUnit_Framework_Assert::readAttribute($webshot, 'timeout'));
$webshot->setTimeout(10);
$this->assertEquals(10, PHPUnit_Framework_Assert::readAttribute($webshot, 'timeout'));
}
示例8: testContracts
public function testContracts()
{
$this->assertTrue($this->reflectedObject->isAbstract());
$this->assertTrue($this->reflectedObject->hasMethod('cleanVar'));
$this->assertTrue($this->reflectedObject->hasMethod('getVar'));
$this->assertInstanceOf('\\Xoops\\Core\\Text\\Sanitizer', \PHPUnit_Framework_Assert::readAttribute($this->object, 'ts'));
}
示例9: testLoadHttp
public function testLoadHttp()
{
MockTest::inject($this->_load, 'conf', ['conf' => ['tmp' => ['router' => MockTest::mockFileSystem([''])]]]);
MockTest::inject($this->_load, 'routerYaml', MockTest::mockFile('router.yml'));
$this->_load->loadHttp();
$this->assertInstanceOf('App\\Resource\\Http', \PHPUnit_Framework_Assert::readAttribute($this->_load, 'http'));
}
示例10: testSetConfigValueValid
public function testSetConfigValueValid()
{
$client = new Client();
$client->setConfig('scope', 'basic_user_info autoupload');
$config = PHPUnit_Framework_Assert::readAttribute($client, 'config');
$this->assertEquals('basic_user_info autoupload', $config->scope);
}
示例11: testConstructor
public function testConstructor()
{
$_conf = \PHPUnit_Framework_Assert::readAttribute($this->ibc, 'conf');
$_query = \PHPUnit_Framework_Assert::readAttribute($this->ibc, 'query');
$this->assertInstanceOf('Conf\\Conf', $_conf);
$this->assertInstanceOf('DataBase\\Query\\Query', $_query);
}
示例12: testAddErrorsArray
public function testAddErrorsArray()
{
MockTest::inject($this->validatorFactory, 'errorArray', ['anyKey' => 'initState']);
$errors = ['anyKey2' => 'anyErrors'];
MockTest::callMockMethod($this->validatorFactory, 'addErrors', [$errors]);
$this->assertEquals(\PHPUnit_Framework_Assert::readAttribute($this->validatorFactory, 'errorArray'), ['anyKey' => 'initState', 'anyKey2' => 'anyErrors']);
}
示例13: testRequestFactory
public function testRequestFactory()
{
$configuration = new GenericConfiguration();
$configuration->setApiKey('12345')->setTrackingKey('trackkey')->setDigitalSign('dummydigitalsign')->setRequest(new Request());
$request = RequestFactory::createRequest($configuration);
$this->assertSame($configuration, \PHPUnit_Framework_Assert::readAttribute($request, 'configuration'));
}
示例14: testSetAttributes
/**
* Test setting the attributes array.
*
* @covers ::setAttributes
*/
public function testSetAttributes()
{
$bag = new CasPropertyBag($this->randomMachineName(8));
$attributes = array('foo' => array('bar'), 'baz' => array('quux, foobar'));
$bag->setAttributes($attributes);
$this->assertEquals($attributes, \PHPUnit_Framework_Assert::readAttribute($bag, 'attributes'));
}
示例15: testConstructor
public function testConstructor()
{
$_display = \PHPUnit_Framework_Assert::readAttribute($this->_controller, '_display');
$this->assertInstanceOf('Ignaszak\\Exception\\Modules\\Display', $_display);
$_logFile = \PHPUnit_Framework_Assert::readAttribute($this->_controller, '_logFile');
$this->assertInstanceOf('Ignaszak\\Exception\\Modules\\LogFile', $_logFile);
}