Skip to content

Commit 536fff2

Browse files
committed
adding documentation
1 parent f198f03 commit 536fff2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ Run `composer update`
4545
$results = $client->search(array('term' => 'Sushi', 'location' => 'Chicago, IL'));
4646
```
4747

48+
### Search by phone number
49+
50+
```php
51+
$results = $client->searchByPhone(array('phone' => '867-5309'));
52+
```
53+
4854
### Locate details for a specific business by Yelp business id
4955

5056
```php

tests/YelpTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ public function test_It_Can_Search_Bars_In_Chicago()
6262
$this->assertEquals(3, count($results->businesses));
6363
}
6464

65+
public function test_It_Can_Search_By_Phone()
66+
{
67+
$phone = '(312) 822-2900';
68+
$attributes = ['phone' => $phone];
69+
70+
$results = $this->client->searchByPhone($attributes);
71+
72+
$this->assertInstanceOf('stdClass', $results);
73+
$this->assertNotEmpty($results->businesses);
74+
$this->assertEquals(1, count($results->businesses));
75+
}
76+
6577
public function test_It_Can_Set_Defaults()
6678
{
6779
$default_term = 'stores';

0 commit comments

Comments
 (0)