-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from jeroendesloovere/pr/35
Pr/35
- Loading branch information
Showing
3 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,29 @@ | |
*/ | ||
class VCardTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var VCard | ||
*/ | ||
protected $vcard = null; | ||
|
||
/** | ||
* Data provider for testEmail() | ||
* | ||
* @return array | ||
*/ | ||
public function emailDataProvider() { | ||
return array( | ||
array(array('[email protected]')), | ||
array(array('[email protected]', 'WORK' => '[email protected]')), | ||
array(array('WORK' => '[email protected]', 'HOME' => '[email protected]')), | ||
array(array('PREF;WORK' => '[email protected]', 'HOME' => '[email protected]')), | ||
); | ||
} | ||
|
||
/** | ||
* Set up before class | ||
* | ||
* @return SocialMedia | ||
* @return void | ||
*/ | ||
public function setUp() | ||
{ | ||
|
@@ -106,7 +125,32 @@ public function testFullBlownName() | |
$this->assertEquals('mister-jeroen-desloovere-junior', $this->vcard->getFilename()); | ||
} | ||
|
||
public function testAddAdress() | ||
<<<<<<< HEAD | ||
/** | ||
* @test | ||
* @dataProvider emailDataProvider | ||
*/ | ||
public function testEmail($emails = array()) | ||
{ | ||
foreach ($emails as $key => $email) { | ||
if (is_string($key)) { | ||
$this->vcard->addEmail($email, $key); | ||
} else { | ||
$this->vcard->addEmail($email); | ||
} | ||
} | ||
|
||
foreach ($emails as $key => $email) { | ||
if (is_string($key)) { | ||
$this->assertContains('EMAIL;INTERNET;' . $key . ':' . $email, $this->vcard->getOutput()); | ||
} else { | ||
$this->assertContains('EMAIL;INTERNET:' . $email, $this->vcard->getOutput()); | ||
} | ||
|
||
} | ||
} | ||
|
||
public function testAddAddress() | ||
{ | ||
$this->assertEquals($this->vcard, $this->vcard->addAddress()); | ||
} | ||
|
@@ -126,7 +170,7 @@ public function testAddEmail() | |
$this->assertEquals($this->vcard, $this->vcard->addEmail('')); | ||
} | ||
|
||
public function testAddjobtitle() | ||
public function testAddJobTitle() | ||
{ | ||
$this->assertEquals($this->vcard, $this->vcard->addJobtitle('')); | ||
} | ||
|
@@ -146,15 +190,15 @@ public function testAddPhoneNumber() | |
$this->assertEquals($this->vcard, $this->vcard->addPhoneNumber('')); | ||
} | ||
|
||
public function testAddUrl() | ||
{ | ||
$this->assertEquals($this->vcard, $this->vcard->addUrl('')); | ||
} | ||
|
||
public function testAddPhotoWithJpgPhoto() | ||
{ | ||
$return = $this->vcard->addPhoto(__DIR__.'/image.jpg', true); | ||
|
||
$this->assertEquals($this->vcard, $return); | ||
} | ||
|
||
public function testAddUrl() | ||
{ | ||
$this->assertEquals($this->vcard, $this->vcard->addUrl('')); | ||
} | ||
} |