assertSame('', MDUtils::stripIndent('')); $this->assertSame('', MDUtils::stripIndent(' ')); $this->assertSame('foo', MDUtils::stripIndent('foo')); $this->assertSame('foo', MDUtils::stripIndent(' foo')); $this->assertSame('foo', MDUtils::stripIndent(' foo')); $this->assertSame('foo', MDUtils::stripIndent(' foo')); $this->assertSame('foo', MDUtils::stripIndent(' foo')); $this->assertSame(' foo', MDUtils::stripIndent(' foo')); $this->assertSame('foo', MDUtils::stripIndent("\tfoo")); $this->assertSame("\tfoo", MDUtils::stripIndent("\t\tfoo")); $this->assertSame('foo', MDUtils::stripIndent("\t\tfoo", 2)); $this->assertSame('foo', MDUtils::stripIndent(' foo', 2)); } public function test_countIndents() { $this->assertSame(0, MDUtils::countIndents('')); $this->assertSame(1, MDUtils::countIndents(' ')); $this->assertSame(1, MDUtils::countIndents(' ')); $this->assertSame(0, MDUtils::countIndents('foo')); $this->assertSame(0, MDUtils::countIndents('foo')); $this->assertSame(1, MDUtils::countIndents(' foo')); $this->assertSame(1, MDUtils::countIndents(' foo')); $this->assertSame(1, MDUtils::countIndents(' foo')); $this->assertSame(1, MDUtils::countIndents(' foo')); $this->assertSame(2, MDUtils::countIndents(' foo')); $this->assertSame(1, MDUtils::countIndents("\tfoo")); $this->assertSame(2, MDUtils::countIndents("\t\tfoo")); $this->assertSame(0, MDUtils::countIndents('', true)); $this->assertSame(0, MDUtils::countIndents(' ', true)); $this->assertSame(1, MDUtils::countIndents(' ', true)); $this->assertSame(0, MDUtils::countIndents('foo', true)); $this->assertSame(0, MDUtils::countIndents(' foo', true)); $this->assertSame(0, MDUtils::countIndents(' foo', true)); $this->assertSame(0, MDUtils::countIndents(' foo', true)); $this->assertSame(1, MDUtils::countIndents(' foo', true)); $this->assertSame(1, MDUtils::countIndents(' foo', true)); $this->assertSame(1, MDUtils::countIndents("\tfoo", true)); $this->assertSame(2, MDUtils::countIndents("\t\tfoo", true)); } } ?>