From c854a7cbaf8716c40ccdcc3903d70dfff3af6109 Mon Sep 17 00:00:00 2001 From: Karl Hughes Date: Fri, 6 Jan 2017 13:55:54 -0600 Subject: [PATCH] Updating query --- src/Queries/MonsterQuery.php | 112 +----------------- ...oviderTest.php => MonsterProviderTest.php} | 0 tests/src/MonsterQueryTest.php | 10 +- 3 files changed, 10 insertions(+), 112 deletions(-) rename tests/src/{JobinventoryProviderTest.php => MonsterProviderTest.php} (100%) diff --git a/src/Queries/MonsterQuery.php b/src/Queries/MonsterQuery.php index 777a214..2716681 100644 --- a/src/Queries/MonsterQuery.php +++ b/src/Queries/MonsterQuery.php @@ -12,124 +12,22 @@ class MonsterQuery extends AbstractQuery protected $q; /** - * l + * where * * The search location. * * @var string */ - protected $l; + protected $where; /** - * limit - * - * Number of results per page - * - * @var integer - */ - protected $limit; - - /** - * p + * page * * Page * * @var integer */ - protected $p; - - /** - * radius - * - * Miles away to search - * - * @var integer - */ - protected $radius; - - /** - * t - * - * Job title. - * - * @var string - */ - protected $t; - - /** - * company - * - * @var string - */ - protected $company; - - /** - * date - * - * Number of days back to search. - * - * @var integer - */ - protected $date; - - /** - * jobtype - * - * Valid options include: - * Full-time - * Contract - * Part-time - * Temporary - * Seasonal - * - * @var string - */ - protected $jobtype; - - /** - */ - - /** - * education - * - * Valid options include: - * Professional - * High School - * Doctorate - * Associate's Degree - * Some College - * Bachelor's Degree - * - * @var string - */ - protected $education; - - /** - * c - * - * Category (see website for options). - * - * @var string - */ - protected $c; - - /** - * o - * - * Job source (see website for options). - * - * @var string - */ - protected $o; - - /** - * experience - * - * Experience required (see website for options). - * - * @var string - */ - protected $experience; + protected $page; /** * Get baseUrl @@ -138,7 +36,7 @@ class MonsterQuery extends AbstractQuery */ public function getBaseUrl() { - return 'http://www.jobinventory.com/rss'; + return 'http://rss.jobsearch.monster.com/rssquery.ashx'; } /** diff --git a/tests/src/JobinventoryProviderTest.php b/tests/src/MonsterProviderTest.php similarity index 100% rename from tests/src/JobinventoryProviderTest.php rename to tests/src/MonsterProviderTest.php diff --git a/tests/src/MonsterQueryTest.php b/tests/src/MonsterQueryTest.php index ae54a6e..03424a0 100644 --- a/tests/src/MonsterQueryTest.php +++ b/tests/src/MonsterQueryTest.php @@ -13,7 +13,7 @@ public function setUp() public function testItCanGetBaseUrl() { $this->assertEquals( - 'http://www.jobinventory.com/rss', + 'http://rss.jobsearch.monster.com/rssquery.ashx', $this->query->getBaseUrl() ); } @@ -40,12 +40,12 @@ public function testItReturnsTrueIfRequiredAttributesPresent() public function testItCanAddAttributesToUrl() { $this->query->set('q', uniqid()); - $this->query->set('l', uniqid()); + $this->query->set('where', uniqid()); $url = $this->query->getUrl(); $this->assertContains('q=', $url); - $this->assertContains('l=', $url); + $this->assertContains('where=', $url); } /** @@ -68,8 +68,8 @@ public function testItSetsAndGetsValidAttributes() { $attributes = [ 'q' => uniqid(), - 'l' => uniqid(), - 'radius' => rand(1,100), + 'where' => uniqid(), + 'page' => rand(1,100), ]; foreach ($attributes as $key => $value) {