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


PHP predicate\equals函数代码示例

本文整理汇总了PHP中bovigo\assert\predicate\equals函数的典型用法代码示例。如果您正苦于以下问题:PHP equals函数的具体用法?PHP equals怎么用?PHP equals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: writesToStandardOutputBuffer

 /**
  * @test
  */
 public function writesToStandardOutputBuffer()
 {
     $out = new StandardOutputStream();
     ob_start();
     $out->write('foo');
     assert(ob_get_contents(), equals('foo'));
     ob_end_clean();
 }
开发者ID:stubbles,项目名称:stubbles-streams,代码行数:11,代码来源:StandardOutputStreamTest.php

示例2: canIterateOverNonSeekableInputStream

 /**
  * @test
  */
 public function canIterateOverNonSeekableInputStream()
 {
     $inputStream = NewInstance::of(InputStream::class)->mapCalls(['readLine' => onConsecutiveCalls('foo', 'bar', 'baz', ''), 'eof' => onConsecutiveCalls(false, false, false, true)]);
     $content = [];
     foreach (linesOf($inputStream) as $lineNumber => $line) {
         $content[$lineNumber] = $line;
     }
     assert($content, equals([1 => 'foo', 2 => 'bar', 3 => 'baz']));
 }
开发者ID:stubbles,项目名称:stubbles-streams,代码行数:12,代码来源:InputStreamIteratorTest.php

示例3: keyConsumerIsNotCalledWhenNoKeyInForeachRequested

 /**
  * @test
  */
 public function keyConsumerIsNotCalledWhenNoKeyInForeachRequested()
 {
     $i = 0;
     $peek = new Peek(new \ArrayIterator(['foo' => 303, 'bar' => 404, 'baz' => 505]), function () {
     }, function () {
         fail('Key consumer is not expected to be called');
     });
     foreach ($peek as $value) {
         $i++;
     }
     assert($i, equals(3));
 }
开发者ID:stubbles,项目名称:stubbles-sequence,代码行数:15,代码来源:PeekTest.php

示例4: infiniteGeneratorDoesStopOnlyWhenBreakOutOfLoop

 /**
  * @test
  */
 public function infiniteGeneratorDoesStopOnlyWhenBreakOutOfLoop()
 {
     $i = 0;
     foreach (Generator::infinite(0, function ($value) {
         return $value + 2;
     }) as $key => $value) {
         if (1000 > $key) {
             $i++;
         } else {
             break;
         }
     }
     assert($i, equals(1000));
 }
开发者ID:stubbles,项目名称:stubbles-sequence,代码行数:17,代码来源:GeneratorTest.php

示例5: parseRecognizesHttpsUris

 /**
  * @test
  */
 public function parseRecognizesHttpsUris()
 {
     assert(Parse::toType('https://example.net/'), equals(HttpUri::fromString('https://example.net/')));
 }
开发者ID:stubbles,项目名称:stubbles-peer,代码行数:7,代码来源:ParseTest.php

示例6: handleSignalsResultOfResponsibleErrorHandlerIfErrorReportingEnabled

 /**
  * @test
  */
 public function handleSignalsResultOfResponsibleErrorHandlerIfErrorReportingEnabled()
 {
     $oldLevel = error_reporting(E_ALL);
     try {
         $this->errorHandler1->mapCalls(['isResponsible' => false]);
         $this->errorHandler2->mapCalls(['isResponsible' => true, 'isSupressable' => false, 'handle' => ErrorHandler::STOP_ERROR_HANDLING]);
         assert($this->errorHandlers->handle(1, 'foo'), equals(ErrorHandler::STOP_ERROR_HANDLING));
     } finally {
         error_reporting($oldLevel);
     }
 }
开发者ID:stubbles,项目名称:stubbles-ioc,代码行数:14,代码来源:ErrorHandlersTest.php

示例7: writeLinesWritesBytesIntoBuffer

 /**
  * @test
  * @since  3.2.0
  */
 public function writeLinesWritesBytesIntoBuffer()
 {
     $this->memoryOutputStream->writeLines(['hello', 'world']);
     assert($this->memoryOutputStream->buffer(), equals("hello\nworld\n"));
 }
开发者ID:stubbles,项目名称:stubbles-streams,代码行数:9,代码来源:MemoryOutputStreamTest.php

示例8: typeOfOtherValuesReturnsNativeType

 /**
  * @param  mixed   $value
  * @param  string  $expectedType
  * @test
  * @dataProvider  valueTypes
  * @since  7.0.0
  */
 public function typeOfOtherValuesReturnsNativeType($value, string $expectedType)
 {
     assert(typeOf($value), equals($expectedType));
 }
开发者ID:stubbles,项目名称:stubbles-values,代码行数:11,代码来源:FunctionsTest.php

示例9: deleteWritesCorrectRequestWithVersion

 /**
  * @since   2.0.0
  * @test
  */
 public function deleteWritesCorrectRequestWithVersion()
 {
     $this->createHttpRequest()->delete(5, HttpVersion::HTTP_1_0);
     assert($this->memory, equals(Http::lines('DELETE /foo/resource HTTP/1.0', 'Host: example.com', 'X-Binford: 6100', '')));
 }
开发者ID:stubbles,项目名称:stubbles-peer,代码行数:9,代码来源:HttpRequestTest.php

示例10: returnsParsedValuesForCommonProperties

 /**
  * @test
  * @since  4.1.0
  */
 public function returnsParsedValuesForCommonProperties()
 {
     assert($this->createPropertyBinding('DEV')->getInstance($this->injector, 'baz'), equals(reflect(Properties::class)));
 }
开发者ID:stubbles,项目名称:stubbles-ioc,代码行数:8,代码来源:PropertyBindingTest.php

示例11: bytesLeftCallsDecoratedStream

 /**
  * @test
  */
 public function bytesLeftCallsDecoratedStream()
 {
     assert($this->decoratedInputStream->bytesLeft(), equals(4));
 }
开发者ID:stubbles,项目名称:stubbles-streams,代码行数:7,代码来源:DecoratedInputStreamTest.php

示例12: writeLinesPassesBytesWithLinebreakIntoStream

 /**
  * @test
  * @since  3.2.0
  */
 public function writeLinesPassesBytesWithLinebreakIntoStream()
 {
     $file = vfsStream::newFile('test.txt')->at($this->root);
     $resourceOutputStream = $this->createResourceOutputStream(fopen(vfsStream::url('root/test.txt'), 'w'));
     assert($resourceOutputStream->writeLines(['foo', 'bar', 'baz']), equals(15));
     assert($file->getContent(), equals("foo\r\nbar\r\nbaz\r\n"));
 }
开发者ID:stubbles,项目名称:stubbles-streams,代码行数:11,代码来源:ResourceOutputStreamTest.php

示例13: partitioningByWithSum

 /**
  * @test
  */
 public function partitioningByWithSum()
 {
     assert(Sequence::of($this->people)->collect()->inPartitions(function (Employee $e) {
         return $e->years() > 10;
     }, Collector::forSum(function (Employee $e) {
         return $e->years();
     })), equals([true => 29, false => 4]));
 }
开发者ID:stubbles,项目名称:stubbles-sequence,代码行数:11,代码来源:CollectorsTest.php

示例14: startsAtPositionZero

 /**
  * @test
  * @since  8.0.0
  */
 public function startsAtPositionZero()
 {
     assert($this->standardInputStream->tell(), equals(0));
 }
开发者ID:stubbles,项目名称:stubbles-streams,代码行数:8,代码来源:StandardInputStreamTest.php

示例15: headerListCanBeCastedToString

 /**
  * @test
  * @since  7.0.0
  */
 public function headerListCanBeCastedToString()
 {
     $headers = "Binford: 6100\r\nX-Power: More power!";
     assert((string) parseHeaders($headers), equals($headers));
 }
开发者ID:stubbles,项目名称:stubbles-peer,代码行数:9,代码来源:HeaderListTest.php


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