Skip to content
Permalink
Browse files

new test placeholders

  • Loading branch information...
Nil Portugués
Nil Portugués committed Dec 10, 2014
1 parent 3b9c6c3 commit 9883054067a09af5f8e9be2142eee07b84e913b1
@@ -1,6 +1,8 @@
#---------------------------------------------------
# PHP Project files to ignore
#---------------------------------------------------
.idea/
build/
vendor/
bin/
tmp/

This file was deleted.

This file was deleted.

@@ -5,9 +5,8 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NilPortugues\Sitemap\Item;
namespace NilPortugues\Sitemap\Item\Image;
use NilPortugues\Sitemap\Validators\ImageValidator;
/**
* Class ImageItem
@@ -6,7 +6,7 @@
* file that was distributed with this source code.
*/
namespace NilPortugues\Sitemap\Item;
namespace NilPortugues\Sitemap\Item\Media;
use NilPortugues\Sitemap\Validators\MediaValidator;
@@ -5,7 +5,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NilPortugues\Sitemap\Item;
namespace NilPortugues\Sitemap\Item\News;
use NilPortugues\Sitemap\Validators\NewsValidator;
@@ -14,7 +14,7 @@ trait ValidatorTrait
* @param $value
* @return bool|string
*/
public static function validateLoc($value)
public function validateLoc($value)
{
if (filter_var($value, FILTER_VALIDATE_URL, array('options' => array('flags' => FILTER_FLAG_PATH_REQUIRED)))) {
return htmlentities($value);
@@ -5,7 +5,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NilPortugues\Sitemap\Item;
namespace NilPortugues\Sitemap\Item\Video;
use NilPortugues\Sitemap\Validators\VideoValidator;
@@ -0,0 +1,14 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Image;
/**
* Class ImageItemTest
* @package Tests\NilPortugues\Sitemap\Item\Image
*/
class ImageItemTest extends \PHPUnit_Framework_TestCase
{
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Image;
/**
* Class ImageItemValidatorTest
* @package Tests\NilPortugues\Sitemap\Item\Image
*/
class ImageItemValidatorTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Index;
/**
* Class IndexItemTest
* @package Tests\NilPortugues\Sitemap\Item\Index
*/
class IndexItemTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Index;
/**
* Class IndexItemValidatorTest
* @package Tests\NilPortugues\Sitemap\Item\Index
*/
class IndexItemValidatorTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Media;
/**
* Class MediaItemTest
* @package Tests\NilPortugues\Sitemap\Item\Media
*/
class MediaItemTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Media;
/**
* Class MediaItemValidatorTest
* @package Tests\NilPortugues\Sitemap\Item\Media
*/
class MediaItemValidatorTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,11 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\News;
/**
* Class NewsItemTest
* @package Tests\NilPortugues\Sitemap\Item\News
*/
class NewsItemTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\News;
/**
* Class NewsItemValidatorTest
* @package Tests\NilPortugues\Sitemap\Item\News
*/
class NewsItemValidatorTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Url;
/**
* Class UrlItemTest
* @package Tests\NilPortugues\Sitemap\Item\Url\UrlItem
*/
class UrlItemTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Url;
/**
* Class UrlItemValidatorTest
* @package Tests\NilPortugues\Sitemap\Item\Url
*/
class UrlItemValidatorTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,80 @@
<?php
namespace itShoulds\NilPortugues\Sitemap\Item;
use NilPortugues\Sitemap\Item\ValidatorTrait;
/**
* Class ValidatorTraititShould
* @package itShoulds\NilPortugues\Sitemap\Item
*/
class ValidatorTraitShould extends \PHPUnit_Framework_TestCase
{
use ValidatorTrait;
/**
* @test
*/
public function itShouldValidateLoc()
{
$result = $this->validateLoc('http://google.com/news');
$this->assertEquals('http://google.com/news', $result);
}
/**
* @test
*/
public function itShouldNotValidateLoc()
{
$result = $this->validateLoc('not-a-url');
$this->assertEquals(false, $result);
}
/**
* @test
*/
public function itShouldValidateDateValidFormat1()
{
$date = new \DateTime('now');
$date = $date->format('c');
$result = $this->validateDate($date);
$this->assertEquals($date, $result);
}
/**
* @test
*/
public function itShouldValidateDateValidFormat2()
{
$date = new \DateTime('now');
$date = $date->format('Y-m-d\TH:i:sP');
$result = $this->validateDate($date);
$this->assertEquals($date, $result);
}
/**
* @test
*/
public function itShouldValidateDateValidFormat3()
{
$date = new \DateTime('now');
$date = $date->format('Y-m-d');
$result = $this->validateDate($date);
$this->assertEquals($date, $result);
}
/**
* @test
*/
public function itShouldValidateDateInvalidFormat()
{
$date = '2A-13-03';
$result = $this->validateDate($date);
$this->assertEquals(false, $result);
}
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Video;
/**
* Class VideoItemTest
* @package Tests\NilPortugues\Sitemap\Item\Video
*/
class VideoItemTest extends \PHPUnit_Framework_TestCase {
}
@@ -0,0 +1,13 @@
<?php
namespace Tests\NilPortugues\Sitemap\Item\Video;
/**
* Class VideoItemValidatorTest
* @package Tests\NilPortugues\Sitemap\Item\Video
*/
class VideoItemValidatorTest extends \PHPUnit_Framework_TestCase {
}

0 comments on commit 9883054

Please sign in to comment.
You can’t perform that action at this time.