ThinkPHP/Library/Vendor/spyc/tests/ParseTest.php

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

require_once ("../Spyc.php");

class ParseTest extends PHPUnit_Framework_TestCase {

    protected $yaml;

    protected function setUp() {
      $this->yaml = spyc_load_file('../spyc.yaml');
    }

    public function testMergeHashKeys() {
      $Expected =  array (
        array ('step' => array('instrument' => 'Lasik 2000', 'pulseEnergy' => 5.4, 'pulseDuration' => 12, 'repetition' => 1000, 'spotSize' => '1mm')),
        array ('step' => array('instrument' => 'Lasik 2000', 'pulseEnergy' => 5.4, 'pulseDuration' => 12, 'repetition' => 1000, 'spotSize' => '2mm')),
      );
      $Actual = spyc_load_file ('indent_1.yaml');
      $this->assertEquals ($Expected, $Actual['steps']);
    }

    public function testDeathMasks() {
      $Expected = array ('sad' => 2, 'magnificent' => 4);
      $Actual = spyc_load_file ('indent_1.yaml');
      $this->assertEquals ($Expected, $Actual['death masks are']);
    }

    public function testDevDb() {
      $Expected = array ('adapter' => 'mysql', 'host' => 'localhost', 'database' => 'rails_dev');
      $Actual = spyc_load_file ('indent_1.yaml');
      $this->assertEquals ($Expected, $Actual['development']);
    }

    public function testNumericKey() {
      $this->assertEquals ("Ooo, a numeric key!", $this->yaml[1040]);
    }

    public function testMappingsString() {
      $this->assertEquals ("Anyone's name, really.", $this->yaml['String']);
    }

    public function testMappingsInt() {
      $this->assertSame (13, $this->yaml['Int']);
    }

    public function testMappingsHex() {
      $this->assertSame (243, $this->yaml['Hex']);
      $this->assertSame ('f0xf3', $this->yaml['BadHex']);
    }

    public function testMappingsBooleanTrue() {
      $this->assertSame (true, $this->yaml['True']);
    }

    public function testMappingsBooleanFalse() {
      $this->assertSame (false, $this->yaml['False']);
    }

    public function testMappingsZero() {
      $this->assertSame (0, $this->yaml['Zero']);
后面还有 341 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。