Skip to content

Commit

Permalink
Updating query
Browse files Browse the repository at this point in the history
  • Loading branch information
karllhughes committed Jan 6, 2017
1 parent 41e64a3 commit c854a7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 112 deletions.
112 changes: 5 additions & 107 deletions src/Queries/MonsterQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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';
}

/**
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions tests/src/MonsterQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand All @@ -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);
}

/**
Expand All @@ -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) {
Expand Down

0 comments on commit c854a7c

Please sign in to comment.