当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_Assert::assertInternalType方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_Assert::assertInternalType方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertInternalType方法的具体用法?PHP PHPUnit_Framework_Assert::assertInternalType怎么用?PHP PHPUnit_Framework_Assert::assertInternalType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_Assert的用法示例。


在下文中一共展示了PHPUnit_Framework_Assert::assertInternalType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get

 public static function get($url, $options = [], $caller = __METHOD__)
 {
     PHPUnit_Framework_Assert::assertInternalType('string', $url);
     PHPUnit_Framework_Assert::assertInternalType('array', $options);
     PHPUnit_Framework_Assert::assertInternalType('string', $caller);
     return self::$response;
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:7,代码来源:MediaWikiPageNameNormalizerTest.php

示例2: it_can_return_its_id

 /**
  * @test
  */
 public function it_can_return_its_id()
 {
     $conn = $this->factory->createConnection('localhost');
     $channel = $this->factory->createChannel($conn);
     Assert::assertInternalType('integer', $channel->getChannelId());
     Assert::assertGreaterThan(0, $channel->getChannelId());
 }
开发者ID:treehouselabs,项目名称:queue,代码行数:10,代码来源:AbstractDriverChannelTest.php

示例3: decodeByProperty

 /**
  * @param string $property
  * @param string $format
  *
  * @return mixed[]
  */
 private function decodeByProperty($property, $format)
 {
     return array_map(function ($entry) use($property) {
         \PHPUnit_Framework_Assert::assertInternalType('array', $entry);
         \PHPUnit_Framework_Assert::assertArrayHasKey($property, $entry);
         return $entry[$property];
     }, $this->decode($format));
 }
开发者ID:php-lug,项目名称:lug,代码行数:14,代码来源:GridApiContext.php

示例4: toBeOfType

 /**
  * Expect that a variable is of a given type.
  *
  * @param string $expected
  * @param string $message
  *
  * @return Expect
  */
 public function toBeOfType($expected, $message = '')
 {
     Assert::assertInternalType($expected, $this->value, $message);
     return $this;
 }
开发者ID:jpkleemans,项目名称:phpunit-expect,代码行数:13,代码来源:Expect.php

示例5: assertResourceCollection

 /**
  * Assert that the data member is a collection, and return it as a resource collection tester.
  *
  * @param string|null $message
  * @return ResourcesTester
  */
 public function assertResourceCollection($message = null)
 {
     $message = $message ?: 'Document does not have a resource collection in its data member.';
     $collection = $this->getData();
     PHPUnit::assertInternalType('array', $collection, $message);
     return new ResourcesTester($collection);
 }
开发者ID:cloudcreativity,项目名称:json-api,代码行数:13,代码来源:DocumentTester.php

示例6: thePropertyIsA

 /**
  * @Then the :name property is a(n) :type
  */
 public function thePropertyIsA($name, $type)
 {
     $data = $this->getScopedResponse();
     PHPUnit::assertInternalType($type, $data->{$name});
 }
开发者ID:rupertjeff,项目名称:ascension-card-db,代码行数:8,代码来源:ApiContext.php

示例7: assertJsonValueEquals

 /**
  * Asserts if the value retrieved with the expression equals the expected value.
  *
  * Example:
  *
  *     static::assertJsonValueEquals(33, 'foo.bar[0]', $json);
  *
  * @param mixed        $expected   Expected value
  * @param string       $expression Expression to retrieve the result
  *                                 (e.g. locations[?state == 'WA'].name | sort(@))
  * @param array|object $json       JSON Content
  */
 public static function assertJsonValueEquals($expected, $expression, $json)
 {
     $result = \JmesPath\Env::search($expression, $json);
     \PHPUnit_Framework_Assert::assertEquals($expected, $result);
     \PHPUnit_Framework_Assert::assertInternalType(gettype($expected), $result);
 }
开发者ID:estahn,项目名称:phpunit-json-assertions,代码行数:18,代码来源:Assert.php

示例8: seePropertyIs

 /**
  * Checks that the property is a passed type.
  * Either 'int', 'bool', 'string', 'array', 'float', 'null', 'resource', 'scalar' can be passed for simple types.
  * Otherwise the parameter must be a class and the property must be an instance of that class.
  *
  * Bear in mind that testing non-public properties is not a good practice.
  * Use it only if you have no other way to test it.
  *
  * @param $object
  * @param $property
  * @param $type
  * @deprecated
  */
 public function seePropertyIs($object, $property, $type)
 {
     $current = $this->retrieveProperty($object, $property);
     if (in_array($type, array('int', 'bool', 'string', 'array', 'float', 'null', 'resource', 'scalar'))) {
         \PHPUnit_Framework_Assert::assertInternalType($type, $current);
         return;
     }
     \PHPUnit_Framework_Assert::assertInstanceOf($type, $current);
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:22,代码来源:Unit.php

示例9: assertInternalType

 /**
  * @param $type
  * @param $actual
  * @param $description
  */
 protected function assertInternalType($type, $actual, $description)
 {
     \PHPUnit_Framework_Assert::assertInternalType($type, $actual, $description);
 }
开发者ID:janhenkgerritsen,项目名称:Codeception,代码行数:9,代码来源:Asserts.php

示例10: testGetAllChannels

 public function testGetAllChannels()
 {
     // Creating response with specific url
     $this->_clientMockAdapter->addResponseBy(Response::STATUS_OK, 'api/channel', json_encode($this->channelsData));
     $repo = new ChannelRepository($this->_client);
     $metadata = array();
     $channels = $repo->getAllRecords(null, $metadata);
     // Checking response (validating specific url was matched)
     \PHPUnit_Framework_Assert::assertTrue($this->_client->getResponse()->isOK());
     // Check return type
     \PHPUnit_Framework_Assert::assertInternalType(\PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $channels);
     // Check return count
     \PHPUnit_Framework_Assert::assertEquals(count($this->channelsData['objects']), count($channels));
     if ($channels) {
         // Check return item type
         \PHPUnit_Framework_Assert::assertInstanceOf(self::MODEL_NAMESPACE . 'Channel', $channels[0]);
     }
     // Validating fields data
     $this->validatesObjectsData($this->channelsData['objects'], $channels);
 }
开发者ID:mobilerider,项目名称:mobilerider-client-php,代码行数:20,代码来源:ChannelRepositoryTest.php

示例11: fetchExpenseListsForMyAccount

 /**
  * @return \stdClass[]
  */
 public function fetchExpenseListsForMyAccount()
 {
     $this->client->request('GET', '/expense_list/');
     $response = $this->client->getResponse();
     PHPUnit_Framework_Assert::assertEquals(Response::HTTP_OK, $response->getStatusCode());
     PHPUnit_Framework_Assert::assertJson($response->getContent());
     $responseData = json_decode($response->getContent());
     PHPUnit_Framework_Assert::assertInternalType('array', $responseData);
     return $responseData;
 }
开发者ID:gobudgit,项目名称:gobudgit,代码行数:13,代码来源:RestExpenseListContext.php

示例12: isInternalType

 public function isInternalType($type)
 {
     Assert::assertInternalType($type, $this->actual, $this->description);
     return $this;
 }
开发者ID:dekeysoft,项目名称:pu-tester,代码行数:5,代码来源:ValueMatcher.php

示例13: testJsonDataResponse

 public function testJsonDataResponse()
 {
     $path = '/test/path';
     $headers = array('h1' => 'a', 'h2' => 'b');
     $parameters = array('p1' => 'c', 'p2' => 'd');
     $method = AbstractClient::METHOD_GET;
     $responseData = array('status' => 'ok', 'data' => 123, 'message' => 'This is a test');
     $responseContent = json_encode($responseData);
     $mockAdapter = new MockAdapter();
     // Adds mock basic OK response
     $mockAdapter->addResponseBy(Response::STATUS_OK, '', $responseContent);
     // Add mock adapter
     $this->_client->setAdapter($mockAdapter);
     // Send request
     $data = $this->_client->get($path, $parameters, $headers);
     // Gets response object
     $response = $this->_client->getResponse();
     // Content is being returned correctly
     \PHPUnit_Framework_Assert::assertJson($response->getRawContent());
     \PHPUnit_Framework_Assert::assertJsonStringEqualsJsonString($responseContent, $response->getRawContent());
     // Content is being parsed correctly (json)
     \PHPUnit_Framework_Assert::assertInternalType(\PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT, $data);
     // Check data parsed
     foreach ($responseData as $key => $value) {
         \PHPUnit_Framework_Assert::assertObjectHasAttribute($key, $data);
         \PHPUnit_Framework_Assert::assertEquals($value, $data->{$key});
     }
     \PHPUnit_Framework_Assert::assertTrue($response->isOK());
 }
开发者ID:mobilerider,项目名称:mobilerider-client-php,代码行数:29,代码来源:ClientTest.php

示例14: internalType

 public function internalType($type)
 {
     a::assertInternalType($type, $this->actual, $this->description);
 }
开发者ID:jaschweder,项目名称:Verify,代码行数:4,代码来源:Verify.php

示例15: thatICreateANewProductNumber

 /**
  * @Given that I create a new product number
  */
 public function thatICreateANewProductNumber()
 {
     $this->new_product_number = substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), 0, 16);
     PHPUnit::assertInternalType('string', $this->new_product_number);
 }
开发者ID:lasselehtinen,项目名称:schilling-soap-wrapper,代码行数:8,代码来源:FeatureContext.php


注:本文中的PHPUnit_Framework_Assert::assertInternalType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。