for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Flaviozantut\Parser;
class ParserTest extends TestCase
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* @expectedException Exception
*/
public function testParserMetadataException()
$parser = new Parser('hello');
}
public function testParser()
$delimiter = Config::get('skorry.metadata_delimiter');
$content = "$delimiter
type: article
title: \"Hello from skorry\"
date: 2011-07-03 5:59
comments: true
external_url:
tags:
permalink:
$delimiter
Hello";
$parser = new Parser($content);
$this->assertInstanceOf('Flaviozantut\Parser', $parser);
return $parser;
* @depends testParser
public function testMetadata($parser)
$metadata = $parser->metadata();
$this->assertArrayHasKey('type', $metadata);
public function testMetadataByIndex($parser)
$metadata = $parser->metadata('type');
$this->assertEquals('article', $parser->metadata('type'));
public function testContent($parser)
$content = $parser->content();
$this->assertEquals('<p>Hello</p>', $content);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.