Skip to content

Commit

Permalink
Add (incomplete) tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lennerd committed Sep 14, 2012
1 parent 1317057 commit 32c2320
Show file tree
Hide file tree
Showing 14 changed files with 284 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
.idea
.DS_Store
.idea/*
vendor/*
38 changes: 38 additions & 0 deletions Bot/Metadata/Loader/MetadataCollection.php
@@ -0,0 +1,38 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Bot\Metadata\Loader;

use Symfony\Component\Config\Resource\ResourceInterface;
use Vipx\BotDetectBundle\Bot\Metadata\MetadataInterface;

class MetadataCollection
{

private $resources = array();
private $metadatas = array();

public function addResource(ResourceInterface $resource)
{
$this->resources[] = $resource;
}

public function addMetadata(MetadataInterface $metadata)
{
$this->metadatas[$metadata->getName()] = $metadata;
}

public function getResources()
{
return $this->resources;
}

public function getMetadatas()
{
return $this->metadatas;
}

}
22 changes: 22 additions & 0 deletions Tests/Bot/BotDetectorTest.php
@@ -0,0 +1,22 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\Bot;

class BotDetectorTest extends \PHPUnit_Framework_TestCase
{

public function testDetection()
{
$this->markTestIncomplete();
}

public function testSettingOptions()
{
$this->markTestIncomplete();
}

}
17 changes: 17 additions & 0 deletions Tests/Bot/Dumper/PhpMetadataDumperTest.php
@@ -0,0 +1,17 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\Dumper;

class PhpMetadataDumperTest extends \PHPUnit_Framework_TestCase
{

public function testDump()
{
$this->markTestIncomplete();
}

}
17 changes: 17 additions & 0 deletions Tests/Bot/Loader/YamlFileLoaderTest.php
@@ -0,0 +1,17 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\Bot\Loader;

class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
{

public function testParsing()
{
$this->markTestIncomplete();
}

}
22 changes: 22 additions & 0 deletions Tests/Bot/MetadataTest.php
@@ -0,0 +1,22 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\Bot;

class MetadataTest extends \PHPUnit_Framework_TestCase
{

public function testMatchExact()
{
$this->markTestIncomplete();
}

public function testMatchRegexp()
{
$this->markTestIncomplete();
}

}
17 changes: 17 additions & 0 deletions Tests/DependencyInjection/Compiler/MetadataResolverPassTest.php
@@ -0,0 +1,17 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\DependencyInjection;

class MetadataResolverPassTest extends \PHPUnit_Framework_TestCase
{

public function testAddingTaggedServices()
{
$this->markTestIncomplete();
}

}
22 changes: 22 additions & 0 deletions Tests/DependencyInjection/VipxBotDetectExtensionTest.php
@@ -0,0 +1,22 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\DependencyInjection;

class VipxBotDetectExtensionTest extends \PHPUnit_Framework_TestCase
{

public function testListenerExtension()
{
$this->markTestIncomplete();
}

public function testParameters()
{
$this->markTestIncomplete();
}

}
17 changes: 17 additions & 0 deletions Tests/Security/BotAuthenticationListenerTest.php
@@ -0,0 +1,17 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\Security;

class BotAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
{

public function testSettingToken()
{
$this->markTestIncomplete();
}

}
17 changes: 17 additions & 0 deletions Tests/Security/BotTokenTest.php
@@ -0,0 +1,17 @@
<?php

/*
* (c) Lennart Hildebrandt <code@lennerd.com>
*/

namespace Vipx\BotDetectBundle\Tests\Security;

class BotTokenTest extends \PHPUnit_Framework_TestCase
{

public function testBotRole()
{
$this->markTestIncomplete();
}

}
16 changes: 16 additions & 0 deletions Tests/bootstrap.php
@@ -0,0 +1,16 @@
<?php

/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

if (!is_file($autoloadFile = __DIR__.'/../vendor/autoload.php')) {
throw new \LogicException('Could not find autoload.php in vendor/. Did you run "composer install --dev"?');
}

require $autoloadFile;
11 changes: 9 additions & 2 deletions composer.json
Expand Up @@ -13,8 +13,15 @@
],
"minimum-stability": "dev",
"require": {
"php": ">=5.3.2",
"symfony/framework-bundle": "2.1.*"
"php": ">=5.3.2"
},
"require-dev": {
"symfony/http-foundation": "2.1.*",
"symfony/http-kernel": "2.1.*",
"symfony/dependency-injection": "2.1.*",
"symfony/security": "2.1.*",
"symfony/config": "2.1.*",
"symfony/yaml": "2.1.*"
},
"autoload": {
"psr-0": { "Vipx\\BotDetectBundle": "" }
Expand Down
57 changes: 57 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions phpunit.xml.dist
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="./Tests/bootstrap.php" colors="true">

<testsuites>
<testsuite name="VipxBotDetectBundle test suite">
<directory suffix="Test.php">./Tests</directory>
</testsuite>
</testsuites>

</phpunit>

0 comments on commit 32c2320

Please sign in to comment.