From ac0903530a4c130446125440b9e18616e9539ac6 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Tue, 9 Jan 2018 00:15:18 -0600 Subject: [PATCH 1/7] Bumped copyright, expanded PHP versions --- .travis.yml | 8 +++----- LICENSE | 2 +- composer.json | 31 ++++++++++++++++++++----------- src/ProjectHoneyPot.php | 2 +- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8bfb40e..92dc405 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,10 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 + - 7.1 + - 7.2 - hhvm - - hhvm-nightly - -matrix: - allow_failures: - - php: hhvm-nightly install: - composer install diff --git a/LICENSE b/LICENSE index be2bff2..714cd64 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2012-2014 Josh Sherman +Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2018 Josh Sherman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/composer.json b/composer.json index 8bef239..82637be 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,25 @@ { - "name": "joshtronic/php-projecthoneypot", + "name": "joshtronic/php-projecthoneypot", "description": "PHP Wrapper for Project Honey Pot", - "version": "1.0.0", - "type": "library", - "keywords": ["project", "honey", "pot", "api", "spam", "spammer"], - "homepage": "https://github.com/joshtronic/php-projecthoneypot", - "license": "MIT", - "authors": [{ - "name": "Josh Sherman", - "email": "hello@joshtronic.com", - "homepage": "http://joshtronic.com" - }], + "version": "1.0.1", + "type": "library", + "keywords": [ + "project", + "honey", + "pot", + "api", + "spam", + "spammer" + ], + "homepage": "https://github.com/joshtronic/php-projecthoneypot", + "license": "MIT", + "authors": [ + { + "name": "Josh Sherman", + "email": "hello@joshtronic.com", + "homepage": "https://joshtronic.com" + } + ], "require-dev": { "php": ">=5.3.0" }, diff --git a/src/ProjectHoneyPot.php b/src/ProjectHoneyPot.php index 613b5f1..a546b1b 100644 --- a/src/ProjectHoneyPot.php +++ b/src/ProjectHoneyPot.php @@ -9,7 +9,7 @@ * Redistribution of these files must retain the above copyright notice. * * @author Josh Sherman - * @copyright Copyright 2012-2015, Josh Sherman + * @copyright Copyright 2012, 2013, 2014, 2015, 2016, 2017, 2018 Josh Sherman * @license http://www.opensource.org/licenses/mit-license.html * @link https://github.com/joshtronic/php-projecthoneypot * @link http://www.projecthoneypot.org/httpbl_configure.php From 5d7000bf8ac4852b6c6fe2a8959e916f00058392 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Tue, 9 Jan 2018 00:19:26 -0600 Subject: [PATCH 2/7] Changes to get older and newer tests running --- .travis.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92dc405..b9edc08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,32 @@ language: php +dist: trusty +sudo: required -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - hhvm +matrix: + include: + - php: 5.3 + dist: precise + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: hhvm + env: HHVM=true install: - composer install + - if [[ $HHVM == true ]]; then composer require "phpunit/phpunit:5.7"; fi before_script: - mkdir -p build/logs - cd tests script: - - phpunit --colors --coverage-clover /home/travis/build/joshtronic/php-projecthoneypot/build/logs/clover.xml . + - if [[ $HHVM == true ]]; then ../vendor/bin/phpunit --colors --coverage-clover ../build/logs/clover.xml .; fi + - if [[ $HHVM != true ]]; then phpunit --colors --coverage-clover ../build/logs/clover.xml .; fi after_success: - - php ../vendor/bin/coveralls --config ../.coveralls.yml -v + - cd .. + - php vendor/bin/coveralls --config .coveralls.yml -v From ba8f480f5e9c895ec337a448573baaeebe1f45a7 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Tue, 9 Jan 2018 00:26:46 -0600 Subject: [PATCH 3/7] Pin coveralls version --- composer.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 82637be..7a4e85b 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ "license": "MIT", "authors": [ { - "name": "Josh Sherman", - "email": "hello@joshtronic.com", + "name": "Josh Sherman", + "email": "hello@joshtronic.com", "homepage": "https://joshtronic.com" } ], @@ -24,9 +24,11 @@ "php": ">=5.3.0" }, "require-dev": { - "satooshi/php-coveralls": "dev-master" + "satooshi/php-coveralls": "~1.0" }, "autoload": { - "psr-4": {"joshtronic\\": "src/"} + "psr-4": { + "joshtronic\\": "src/" + } } } From ddfe2b126af7c56fb6efe7c106df685c4d99da37 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sun, 14 Jan 2018 22:56:33 -0600 Subject: [PATCH 4/7] Alias TestCase and some cleanup --- tests/ProjectHoneyPotTest.php | 84 +++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 33 deletions(-) diff --git a/tests/ProjectHoneyPotTest.php b/tests/ProjectHoneyPotTest.php index 38128db..508ba58 100644 --- a/tests/ProjectHoneyPotTest.php +++ b/tests/ProjectHoneyPotTest.php @@ -2,6 +2,13 @@ require_once '../src/ProjectHoneyPot.php'; +if ( + !class_exists('\PHPUnit_Framework_TestCase') + && class_exists('\PHPUnit\Framework\TestCase') +) { + class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase'); +} + class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase { /** @@ -31,9 +38,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue('foo')); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue('foo')); $this->assertFalse($mock->query('1.2.3.4')); } @@ -46,9 +54,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.0')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.0')))); $results = $mock->query('1.2.3.4'); @@ -63,9 +72,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.1')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.1')))); $results = $mock->query('1.2.3.4'); @@ -80,9 +90,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.2')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.2')))); $results = $mock->query('1.2.3.4'); @@ -97,9 +108,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.3')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.3')))); $results = $mock->query('1.2.3.4'); @@ -117,9 +129,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.4')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.4')))); $results = $mock->query('1.2.3.4'); @@ -137,9 +150,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.5')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.5')))); $results = $mock->query('1.2.3.4'); @@ -157,9 +171,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.6')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.6')))); $results = $mock->query('1.2.3.4'); @@ -177,9 +192,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.7')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.7')))); $results = $mock->query('1.2.3.4'); @@ -197,9 +213,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '127.0.0.255')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '127.0.0.255')))); $results = $mock->query('1.2.3.4'); @@ -217,9 +234,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase array('foobarfoobar') ); - $mock->expects($this->once()) - ->method('dns_get_record') - ->will($this->returnValue(array(array('ip' => '1.0.0.0')))); + $mock + ->expects($this->once()) + ->method('dns_get_record') + ->will($this->returnValue(array(array('ip' => '1.0.0.0')))); $this->assertFalse($mock->query('1.2.3.4')); } From 5a9b6ec5c887a1b51a42b6205aba4ad0ddf36bd2 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sun, 14 Jan 2018 23:11:11 -0600 Subject: [PATCH 5/7] Conditional mock method --- tests/ProjectHoneyPotTest.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/ProjectHoneyPotTest.php b/tests/ProjectHoneyPotTest.php index 508ba58..bc8011a 100644 --- a/tests/ProjectHoneyPotTest.php +++ b/tests/ProjectHoneyPotTest.php @@ -9,6 +9,12 @@ if ( class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase'); } +$createMock = 'createMock'; + +if (version_compare(PHPUnit_Runner_Version::id(), '5.4', '<=')) { + $createMock = 'getMock'; +} + class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase { /** @@ -32,7 +38,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testMissingResults() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -48,7 +54,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory0() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -66,7 +72,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory1() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -84,7 +90,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory2() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -102,7 +108,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory3() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -123,7 +129,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory4() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -144,7 +150,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory5() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -165,7 +171,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory6() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -186,7 +192,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategory7() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -207,7 +213,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testCategoryDefault() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') @@ -228,7 +234,7 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase public function testWithout127() { - $mock = $this->getMock( + $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', array('dns_get_record'), array('foobarfoobar') From 6a70fd2f26f5e5706868a15e21448060b4dc8c05 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sun, 26 Jan 2020 17:23:06 -0600 Subject: [PATCH 6/7] ci: add newer PHP versions Seems I had started this a while back and never actually finished. Bumped the copyright years and added a funding and git ignore file. Redid the Travis configuration based on my more recent experiences with testing multiple PHP versions. Updated the development dependencies and added a configuration file for PHPUnit. --- .gitignore | 4 ++++ .travis.yml | 26 ++++++++++++++-------- LICENSE | 2 +- composer.json | 61 +++++++++++++++++++++++++-------------------------- phpunit.xml | 23 +++++++++++++++++++ 5 files changed, 75 insertions(+), 41 deletions(-) create mode 100644 .gitignore create mode 100644 phpunit.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2144a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +composer.lock +composer.phar +.phpunit.result.cache +/vendor/ diff --git a/.travis.yml b/.travis.yml index b9edc08..36d3649 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: php -dist: trusty +dist: bionic sudo: required matrix: @@ -7,26 +7,34 @@ matrix: - php: 5.3 dist: precise - php: 5.4 + dist: trusty - php: 5.5 + dist: trusty - php: 5.6 + dist: trusty - php: 7.0 + dist: xenial - php: 7.1 - php: 7.2 - - php: hhvm - env: HHVM=true + - php: 7.3 + - php: 7.4 + env: COVERAGE=true + - php: nightly + allow_failures: + - php: nightly install: + - php --version - composer install - - if [[ $HHVM == true ]]; then composer require "phpunit/phpunit:5.7"; fi before_script: - mkdir -p build/logs - - cd tests script: - - if [[ $HHVM == true ]]; then ../vendor/bin/phpunit --colors --coverage-clover ../build/logs/clover.xml .; fi - - if [[ $HHVM != true ]]; then phpunit --colors --coverage-clover ../build/logs/clover.xml .; fi + - vendor/bin/phpunit --coverage-clover build/logs/clover.xml after_success: - - cd .. - - php vendor/bin/coveralls --config .coveralls.yml -v + - | + if [[ $COVERAGE ]]; then + travis_retry php vendor/bin/php-coveralls --config .coveralls.yml -v + fi diff --git a/LICENSE b/LICENSE index 714cd64..22de71d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2018 Josh Sherman +Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Josh Sherman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/composer.json b/composer.json index 7a4e85b..87ebba0 100644 --- a/composer.json +++ b/composer.json @@ -1,34 +1,33 @@ { - "name": "joshtronic/php-projecthoneypot", - "description": "PHP Wrapper for Project Honey Pot", - "version": "1.0.1", - "type": "library", - "keywords": [ - "project", - "honey", - "pot", - "api", - "spam", - "spammer" - ], - "homepage": "https://github.com/joshtronic/php-projecthoneypot", - "license": "MIT", - "authors": [ - { - "name": "Josh Sherman", - "email": "hello@joshtronic.com", - "homepage": "https://joshtronic.com" - } - ], - "require-dev": { - "php": ">=5.3.0" - }, - "require-dev": { - "satooshi/php-coveralls": "~1.0" - }, - "autoload": { - "psr-4": { - "joshtronic\\": "src/" - } + "name": "joshtronic/php-projecthoneypot", + "description": "PHP Wrapper for Project Honey Pot", + "version": "1.0.1", + "type": "library", + "keywords": [ + "project", + "honey", + "pot", + "api", + "spam", + "spammer" + ], + "homepage": "https://github.com/joshtronic/php-projecthoneypot", + "license": "MIT", + "authors": [{ + "name": "Josh Sherman", + "email": "hello@joshtronic.com", + "homepage": "https://joshtronic.com" + }], + "require": { + "php": ">=5.3" + }, + "require-dev": { + "php-coveralls/php-coveralls": ">=1", + "phpunit/phpunit": ">=4" + }, + "autoload": { + "psr-4": { + "joshtronic\\": "src/" } + } } diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..6eaac53 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,23 @@ + + + + + tests + + + + + ./src + + + From 932e2ca800437115a26348ddcffe827260fcbee7 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Wed, 20 Nov 2024 16:16:04 -0600 Subject: [PATCH 7/7] chore: stashing old stuff --- src/ProjectHoneyPot.php | 4 +- tests/ProjectHoneyPotTest.php | 112 +++++++++++++++++++++++++--------- 2 files changed, 85 insertions(+), 31 deletions(-) diff --git a/src/ProjectHoneyPot.php b/src/ProjectHoneyPot.php index a546b1b..7d7098c 100644 --- a/src/ProjectHoneyPot.php +++ b/src/ProjectHoneyPot.php @@ -9,7 +9,7 @@ * Redistribution of these files must retain the above copyright notice. * * @author Josh Sherman - * @copyright Copyright 2012, 2013, 2014, 2015, 2016, 2017, 2018 Josh Sherman + * @copyright Copyright 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Josh Sherman * @license http://www.opensource.org/licenses/mit-license.html * @link https://github.com/joshtronic/php-projecthoneypot * @link http://www.projecthoneypot.org/httpbl_configure.php @@ -55,6 +55,8 @@ class ProjectHoneyPot */ public function query($ip_address) { + var_Dump('ip addy', $ip_address, filter_var($ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE)); + // Validates the IP format if (filter_var($ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE)) { // Flips the script, err, IP address diff --git a/tests/ProjectHoneyPotTest.php b/tests/ProjectHoneyPotTest.php index bc8011a..d0db202 100644 --- a/tests/ProjectHoneyPotTest.php +++ b/tests/ProjectHoneyPotTest.php @@ -1,6 +1,5 @@ assertTrue(true); + + if ( + method_exists('PHPUnit_Runner_Version','id') + && version_compare(PHPUnit_Runner_Version::id(), '5.4', '<=') + ) { + return 'getMock'; + } + + return 'createMock'; + } + + // Due to version juggling, did this a bit more manually as the + // declarations were being removed entirely and I wasn't sure which + // versions supported the suggested methods. public function testInvalidKey() { - new joshtronic\ProjectHoneyPot('foo'); + $threw = false; + + try { + new joshtronic\ProjectHoneyPot('foo'); + } catch (Exception $e) { + $threw = true; + + $this->assertEquals( + 'You must specify a valid API key.', + $e->getMessage(), + ); + } + + $this->assertTrue($threw); } public function testInvalidIP() @@ -36,23 +55,29 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase ); } - public function testMissingResults() + /** + * @depends testCreateMock + */ + public function testMissingResults($createMock) { - $mock = $this->$createMock( - 'joshtronic\ProjectHoneyPot', - array('dns_get_record'), - array('foobarfoobar') - ); + $mock = $this->$createMock('joshtronic\ProjectHoneyPot'); $mock ->expects($this->once()) ->method('dns_get_record') + ->with($this->equalTo('4.3.2.1')) ->will($this->returnValue('foo')); - $this->assertFalse($mock->query('1.2.3.4')); + var_dump($mock->query('1.2.3.4')); + + $this->assertNull($mock->query('1.2.3.4')); + // $this->assertFalse($mock->query('1.2.3.4')); } - public function testCategory0() + /** + * @depends testCreateMock + */ + public function testCategory0($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -70,7 +95,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase $this->assertEquals(array('Search Engine'), $results['categories']); } - public function testCategory1() + /** + * @depends testCreateMock + */ + public function testCategory1($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -88,7 +116,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase $this->assertEquals(array('Suspicious'), $results['categories']); } - public function testCategory2() + /** + * @depends testCreateMock + */ + public function testCategory2($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -106,7 +137,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase $this->assertEquals(array('Harvester'), $results['categories']); } - public function testCategory3() + /** + * @depends testCreateMock + */ + public function testCategory3($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -127,7 +161,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase ); } - public function testCategory4() + /** + * @depends testCreateMock + */ + public function testCategory4($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -148,7 +185,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase ); } - public function testCategory5() + /** + * @depends testCreateMock + */ + public function testCategory5($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -169,7 +209,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase ); } - public function testCategory6() + /** + * @depends testCreateMock + */ + public function testCategory6($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -190,7 +233,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase ); } - public function testCategory7() + /** + * @depends testCreateMock + */ + public function testCategory7($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -211,7 +257,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase ); } - public function testCategoryDefault() + /** + * @depends testCreateMock + */ + public function testCategoryDefault($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot', @@ -232,7 +281,10 @@ class ProjectHoneyPotTest extends PHPUnit_Framework_TestCase ); } - public function testWithout127() + /** + * @depends testCreateMock + */ + public function testWithout127($createMock) { $mock = $this->$createMock( 'joshtronic\ProjectHoneyPot',