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


PHP PHPUnit_Framework_TestCase::assertInternalType方法代码示例

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


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

示例1: delete

 /**
  * Stub delete method and add needed asserts
  *
  * @param  string $table
  * @param  array|string $where
  * @return int
  */
 public function delete($table, $where = '')
 {
     \PHPUnit_Framework_TestCase::assertEquals('catalog_product_option_type_title', $table);
     \PHPUnit_Framework_TestCase::assertInternalType('array', $where);
     \PHPUnit_Framework_TestCase::assertEquals(ValueTest::$valueTitleData['id'], $where['option_type_id = ?']);
     \PHPUnit_Framework_TestCase::assertEquals(ValueTest::$valueTitleData['store_id'], $where['store_id = ?']);
     return 0;
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:15,代码来源:MysqlStub.php

示例2: assertInternalType

 /**
  * Calls assertType() or assertInternalType() depending on the PHPUnit version.
  * Available from PHPUnit >= 3.5
  *
  * @param string $expected Expected value
  * @param mixed $actual Actual value
  * @param string $message Message to print if assertion is wrong
  */
 public static function assertInternalType($expected, $actual, $message = '')
 {
     if (self::_checkMethod('assertInternalType')) {
         parent::assertInternalType($expected, $actual, $message);
     } else {
         parent::assertType($expected, $actual, $message);
     }
 }
开发者ID:arcavias,项目名称:arcavias-core,代码行数:16,代码来源:Testcase.php

示例3: assertType

 public static function assertType($x, $y)
 {
     #global $phpunit_version;
     if (version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0) {
         return PHPUnit_Framework_TestCase::assertType($x, $y);
     } else {
         return PHPUnit_Framework_TestCase::assertInternalType($x, $y);
     }
 }
开发者ID:EarthTeam,项目名称:earthteam.net,代码行数:9,代码来源:test.php

示例4: testInvokesDefaultErrorFormatterWhenDebugIsEnabledAndThrowableCaught

 /**
  * @dataProvider throwables
  */
 public function testInvokesDefaultErrorFormatterWhenDebugIsEnabledAndThrowableCaught($throwable)
 {
     $next = function () use($throwable) {
         throw $throwable;
     };
     $this->renderer->render(ErrorHandler::TEMPLATE_ERROR, Argument::that(function ($argument) use($throwable) {
         TestCase::assertInternalType('array', $argument);
         TestCase::assertArrayHasKey('error', $argument);
         $error = $argument['error'];
         TestCase::assertContains($throwable->getMessage(), $error);
         TestCase::assertContains((string) $throwable->getCode(), $error);
         TestCase::assertContains($throwable->getTraceAsString(), $error);
         return true;
     }))->willReturn('error content');
     $handler = new ErrorHandler($this->renderer->reveal(), true);
     $result = $handler($this->createRequestMock()->reveal(), $this->createResponseMock()->reveal(), $next);
     $this->assertInstanceOf(HtmlResponse::class, $result);
     $this->assertEquals(500, $result->getStatusCode());
     $this->assertEquals('error content', (string) $result->getBody());
 }
开发者ID:vrkansagara,项目名称:mwop.net,代码行数:23,代码来源:ErrorHandlerTest.php

示例5: assertInternalType

 /**
  * Asserts that a variable is of a given type.
  *
  * @param string $expected
  * @param mixed  $actual
  * @param string $message
  * @since Method available since Release 3.5.0
  */
 public static function assertInternalType($expected, $actual, $message = '')
 {
     if (self::$_assert_type_compatability) {
         return self::assertType($expected, $actual, $message);
     }
     return parent::assertInternalType($expected, $actual, $message);
 }
开发者ID:lz1988,项目名称:stourwebcms,代码行数:15,代码来源:TestCase.php

示例6: assertInternalType

 /**
  * Helper method to allow PHPUnit versions < 3.5.x
  *
  * @param string $expected The expected internal type.
  * @param mixed  $actual   The actual variable/value.
  * @param string $message  Optional error/fail message.
  *
  * @return void
  * @since 0.10.2
  */
 public static function assertInternalType($expected, $actual, $message = '')
 {
     if (is_callable(get_parent_class(__CLASS__) . '::') . __FUNCTION__) {
         return parent::assertInternalType($expected, $actual, $message);
     }
     return parent::assertType($expected, $actual, $message);
 }
开发者ID:rouffj,项目名称:pdepend,代码行数:17,代码来源:AbstractTest.php

示例7: testGet

 public function testGet()
 {
     $get = $this->entityGet();
     if (is_object($get)) {
         TestCase::assertInstanceOf("Countable", $get, $this->msg(self::$MSG_GET_METHOD_MUST_RETURN_COUNTABLE_OBJECT));
         TestCase::assertInstanceOf("Traversable", $get, $this->msg(self::$MSG_GET_METHOD_MUST_RETURN_TRAVERSABLE_OBJECT));
     } elseif (!is_null($get)) {
         TestCase::assertInternalType("array", $get, $this->msg(self::$MSG_GET_METHOD_MUST_RETURN_AN_ARRAY));
     } else {
         throw new AssertionFailedError($this->msg(self::$MSG_GET_METHOD_MUST_NOT_RETURN_NULL));
     }
 }
开发者ID:jngermon,项目名称:phpunit-entity-tester,代码行数:12,代码来源:AccessorCollectionTester.php

示例8: assertRecord

 /**
  * Checks whether the data we received as post is converted to the right
  * types
  *
  * @param \PHPUnit_Framework_TestCase $testCase
  * @param \PSX\Data\RecordInterface $record
  */
 public static function assertRecord(\PHPUnit_Framework_TestCase $testCase, RecordInterface $record)
 {
     $testCase->assertInternalType('array', $record->getArray());
     $testCase->assertEquals(1, count($record->getArray()));
     $testCase->assertEquals(['bar'], $record->getArray());
     $testCase->assertInternalType('array', $record->getArrayComplex());
     $testCase->assertEquals(2, count($record->getArrayComplex()));
     $testCase->assertInstanceOf('PSX\\Data\\RecordInterface', $record->getArrayComplex()[0]);
     $testCase->assertEquals(['foo' => 'bar'], $record->getArrayComplex()[0]->getRecordInfo()->getFields());
     $testCase->assertInstanceOf('PSX\\Data\\RecordInterface', $record->getArrayComplex()[1]);
     $testCase->assertEquals(['foo' => 'foo'], $record->getArrayComplex()[1]->getRecordInfo()->getFields());
     $testCase->assertInternalType('array', $record->getArrayChoice());
     $testCase->assertEquals(3, count($record->getArrayChoice()));
     $testCase->assertInstanceOf('PSX\\Data\\RecordInterface', $record->getArrayChoice()[0]);
     $testCase->assertEquals(['foo' => 'baz'], $record->getArrayChoice()[0]->getRecordInfo()->getFields());
     $testCase->assertInstanceOf('PSX\\Data\\RecordInterface', $record->getArrayChoice()[1]);
     $testCase->assertEquals(['bar' => 'bar'], $record->getArrayChoice()[1]->getRecordInfo()->getFields());
     $testCase->assertInstanceOf('PSX\\Data\\RecordInterface', $record->getArrayChoice()[2]);
     $testCase->assertEquals(['foo' => 'foo'], $record->getArrayChoice()[2]->getRecordInfo()->getFields());
     $testCase->assertInternalType('boolean', $record->getBoolean());
     $testCase->assertEquals(true, $record->getBoolean());
     $testCase->assertInstanceOf('PSX\\Data\\RecordInterface', $record->getChoice());
     $testCase->assertEquals(['foo' => 'bar'], $record->getComplex()->getRecordInfo()->getFields());
     $testCase->assertInstanceOf('PSX\\Data\\RecordInterface', $record->getComplex());
     $testCase->assertEquals(['foo' => 'bar'], $record->getComplex()->getRecordInfo()->getFields());
     $testCase->assertInstanceOf('PSX\\DateTime\\Date', $record->getDate());
     $testCase->assertEquals('2015-05-01', $record->getDate()->format('Y-m-d'));
     $testCase->assertInstanceOf('PSX\\DateTime', $record->getDateTime());
     $testCase->assertEquals('2015-05-01T13:37:14Z', $record->getDateTime()->format('Y-m-d\\TH:i:s\\Z'));
     $testCase->assertInstanceOf('PSX\\DateTime\\Duration', $record->getDuration());
     $testCase->assertEquals('000100000000', $record->getDuration()->format('%Y%M%D%H%I%S'));
     $testCase->assertInternalType('float', $record->getFloat());
     $testCase->assertEquals(13.37, $record->getFloat());
     $testCase->assertInternalType('integer', $record->getInteger());
     $testCase->assertEquals(7, $record->getInteger());
     $testCase->assertInternalType('string', $record->getString());
     $testCase->assertEquals('bar', $record->getString());
     $testCase->assertInstanceOf('PSX\\DateTime\\Time', $record->getTime());
     $testCase->assertEquals('13:37:14', $record->getTime()->format('H:i:s'));
 }
开发者ID:seytar,项目名称:psx,代码行数:47,代码来源:PropertyTestCase.php


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