當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleDumper::describeValue方法代碼示例

本文整理匯總了PHP中SimpleDumper::describeValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleDumper::describeValue方法的具體用法?PHP SimpleDumper::describeValue怎麽用?PHP SimpleDumper::describeValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleDumper的用法示例。


在下文中一共展示了SimpleDumper::describeValue方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: SimpleDumper

 function assert_attr_read_only($obj, $attr_name, $test_value, $msg = null)
 {
     if (is_null($msg)) {
         $msg = 'Exepected %s not to change but [got: %s] after setting [to: %s] [from: %s]';
     }
     $old_value = @$obj->{$attr_name};
     $this->expectError();
     $obj->{$attr_name} = $test_value;
     $new_value = @$obj->{$attr_name};
     $dumper = new SimpleDumper();
     $msg = sprintf($msg, get_class($obj) . '::$' . $attr_name, $dumper->describeValue($new_value), $dumper->describeValue($test_value), $dumper->describeValue($old_value));
     $this->assertEqual($old_value, $new_value, $msg);
 }
開發者ID:a-ludi,項目名稱:community-service-manager,代碼行數:13,代碼來源:test-person.php

示例2: testDescribeObject

 public function testDescribeObject()
 {
     $dumper = new SimpleDumper();
     $this->assertPattern('/object/i', $dumper->describeValue(new DumperDummy()));
     $this->assertPattern('/DumperDummy/i', $dumper->describeValue(new DumperDummy()));
 }
開發者ID:Clansuite,項目名稱:Clansuite,代碼行數:6,代碼來源:dumper_test.php

示例3: renderArguments

 /**
  *    Renders the argument list as a string for
  *    messages.
  *    @param array $args    Incoming arguments.
  *    @return string        Simple description of type and value.
  */
 protected function renderArguments($args)
 {
     $descriptions = array();
     if (is_array($args)) {
         foreach ($args as $arg) {
             $dumper = new SimpleDumper();
             $descriptions[] = $dumper->describeValue($arg);
         }
     }
     return implode(', ', $descriptions);
 }
開發者ID:Boris-de,項目名稱:videodb,代碼行數:17,代碼來源:mock_objects.php

示例4: assertCopy

 /**
  *    Will trigger a pass if both parameters refer
  *    to different variables. Fail otherwise. The objects
  *    have to be identical references though.
  *    This will fail under E_STRICT with objects. Use
  *    assertClone() for this.
  *    @param mixed $first           Object reference to check.
  *    @param mixed $second          Hopefully not the same object.
  *    @param string $message        Message to display.
  *    @return boolean               True on pass
  *    @access public
  */
 function assertCopy(&$first, &$second, $message = "%s")
 {
     $dumper = new SimpleDumper();
     $message = sprintf($message, "[" . $dumper->describeValue($first) . "] and [" . $dumper->describeValue($second) . "] should not be the same object");
     return $this->assertFalse(SimpleTestCompatibility::isReference($first, $second), $message);
 }
開發者ID:sebs,項目名稱:simpletest,代碼行數:18,代碼來源:unit_tester.php

示例5: assertNotSame

 /**
  * Inverted identity test.
  *
  * @param $first          First object handle.
  * @param $second         Hopefully a different handle.
  * @param $message        Message to display.
  */
 public function assertNotSame($first, $second, $message = '%s')
 {
     $dumper = new SimpleDumper();
     $message = sprintf($message, '[' . $dumper->describeValue($first) . '] and [' . $dumper->describeValue($second) . '] should not be the same object');
     return $this->assert(new falseExpectation(), SimpleTestCompatibility::isReference($first, $second), $message);
 }
開發者ID:guicara,項目名稱:simpletest,代碼行數:13,代碼來源:pear_test_case.php

示例6: contain

 function contain($subject, $target, $message = '%s')
 {
     $dumper = new SimpleDumper();
     $message = "[ {$dumper->describeValue($subject)}] should contain [{$dumper->describeValue($target)}]";
     if (is_array($subject) && is_array($target)) {
         return $this->be_true(array_intersect($target, $subject) == $target, $message);
     } elseif (is_array($subject)) {
         return $this->be_true(in_array($target, $subject), $message);
     } elseif (is_string($subject)) {
         return $this->be_true(strpos($target, $subject) !== false, $message);
     }
 }
開發者ID:herlambang,項目名稱:h2o-php,代碼行數:12,代碼來源:spec.php

示例7: assertNotEmpty

 /**
  * Will be true if the value is not empty.
  *
  * @param  mixed  $value   Supposedly not empty value.
  * @param  string $message Message to display.
  *
  * @return boolean True on pass.
  *
  * @access public
  */
 public function assertNotEmpty($value, $message = '%s')
 {
     $dumper = new SimpleDumper();
     $message = sprintf($message, '[' . $dumper->describeValue($value) . '] should not be empty');
     return $this->assertFalse(empty($value), $message);
 }
開發者ID:ivantcholakov,項目名稱:Bonfire,代碼行數:16,代碼來源:run.php

示例8: assertNotNull

 function assertNotNull($value, $message = '%s')
 {
     $dumper = new SimpleDumper();
     $message = sprintf($message, '[' . $dumper->describeValue($value) . '] should not be null');
     return $this->assertTrue(isset($value), $message);
 }
開發者ID:RussellDias,項目名稱:konstrukt,代碼行數:6,代碼來源:test.php

示例9: assertNotEmpty

 /**
  *    Will be true if the value is not empty.
  *    @param mixed $value           Supposedly set value.
  *    @param string $message        Message to display.
  *    @return boolean               True on pass.
  *    @access public
  */
 function assertNotEmpty($value, $message = "%s")
 {
     $dumper = new SimpleDumper();
     $message = sprintf($message, "[" . $dumper->describeValue($value) . "] should not be null");
     return $this->assertTrue(!empty($value), $message);
 }
開發者ID:hostinger,項目名稱:revive-adserver,代碼行數:13,代碼來源:DalUnitTestCase.php


注:本文中的SimpleDumper::describeValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。