-
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.
use
git reflog
to view all credentials (so removed all credentials)
- Loading branch information
1 parent
6698d15
commit 2a0b7dc
Showing
6 changed files
with
21 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ | |
|
||
/** | ||
* VCard PHP Class to generate .vcard files and save them to a file or output as a download. | ||
* | ||
* @author Jeroen Desloovere <[email protected]> | ||
*/ | ||
class VCard | ||
{ | ||
|
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 |
---|---|---|
|
@@ -11,8 +11,6 @@ | |
|
||
/** | ||
* VCard Exception PHP Class. | ||
* | ||
* @author Jeroen Desloovere <[email protected]> | ||
*/ | ||
class VCardException extends \Exception | ||
{ | ||
|
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 |
---|---|---|
|
@@ -3,22 +3,10 @@ | |
namespace JeroenDesloovere\VCard; | ||
|
||
/* | ||
* Copyright 2010 Thomas Schaaf <[email protected]> | ||
* This file is part of the VCard PHP Class from Jeroen Desloovere. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Changes by: Wouter Admiraal <[email protected]> | ||
* Original code is available at: http://code.google.com/p/zendvcard/ | ||
* For the full copyright and license information, please view the license | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use Iterator; | ||
|
@@ -29,10 +17,6 @@ | |
* This class is heavily based on the Zendvcard project (seemingly abandoned), | ||
* which is licensed under the Apache 2.0 license. | ||
* More information can be found at https://code.google.com/archive/p/zendvcard/ | ||
* | ||
* @author Thomas Schaaf <[email protected]> | ||
* @author ruzicka.jan | ||
* @author Wouter Admiraal <[email protected]> | ||
*/ | ||
class VCardParser implements Iterator | ||
{ | ||
|
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 |
---|---|---|
|
@@ -14,8 +14,6 @@ | |
|
||
/** | ||
* VCard Exception Test. | ||
* | ||
* @author Jeroen Desloovere <[email protected]> | ||
*/ | ||
class VCardExceptionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
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 |
---|---|---|
|
@@ -7,8 +7,6 @@ | |
|
||
/** | ||
* Unit tests for our VCard parser. | ||
* | ||
* @author Wouter Admiraal <[email protected]> | ||
*/ | ||
class VCardParserTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
@@ -24,11 +22,11 @@ public function testOutOfRangeException() | |
public function testSimpleVcard() | ||
{ | ||
$vcard = new VCard(); | ||
$vcard->addName("Admiraal", "Wouter"); | ||
$vcard->addName("Desloovere", "Jeroen"); | ||
$parser = new VCardParser($vcard->buildVCard()); | ||
$this->assertEquals($parser->getCardAtIndex(0)->firstname, "Wouter"); | ||
$this->assertEquals($parser->getCardAtIndex(0)->lastname, "Admiraal"); | ||
$this->assertEquals($parser->getCardAtIndex(0)->fullname, "Wouter Admiraal"); | ||
$this->assertEquals($parser->getCardAtIndex(0)->firstname, "Jeroen"); | ||
$this->assertEquals($parser->getCardAtIndex(0)->lastname, "Desloovere"); | ||
$this->assertEquals($parser->getCardAtIndex(0)->fullname, "Jeroen Desloovere"); | ||
} | ||
|
||
public function testBDay() | ||
|
@@ -53,7 +51,7 @@ public function testAddress() | |
'WORK;POSTAL' | ||
); | ||
$vcard->addAddress( | ||
"Wouter Admiraal", | ||
"Jeroen Desloovere", | ||
"(extended info, again)", | ||
"25th Some Address", | ||
"Townsville", | ||
|
@@ -63,7 +61,7 @@ public function testAddress() | |
'WORK;PERSONAL' | ||
); | ||
$vcard->addAddress( | ||
"Johannes Admiraal", | ||
"Georges Desloovere", | ||
"(extended info, again, again)", | ||
"26th Some Address", | ||
"Townsville-South", | ||
|
@@ -83,7 +81,7 @@ public function testAddress() | |
'country' => "Gitland", | ||
)); | ||
$this->assertEquals($parser->getCardAtIndex(0)->address['WORK;PERSONAL'][0], (object) array( | ||
'name' => "Wouter Admiraal", | ||
'name' => "Jeroen Desloovere", | ||
'extended' => "(extended info, again)", | ||
'street' => "25th Some Address", | ||
'city' => "Townsville", | ||
|
@@ -92,7 +90,7 @@ public function testAddress() | |
'country' => "Europe (is a country, right?)", | ||
)); | ||
$this->assertEquals($parser->getCardAtIndex(0)->address['WORK;PERSONAL'][1], (object) array( | ||
'name' => "Johannes Admiraal", | ||
'name' => "Georges Desloovere", | ||
'extended' => "(extended info, again, again)", | ||
'street' => "26th Some Address", | ||
'city' => "Townsville-South", | ||
|
@@ -143,12 +141,12 @@ public function testOrganization() | |
public function testUrl() | ||
{ | ||
$vcard = new VCard(); | ||
$vcard->addUrl('http://example.com'); | ||
$vcard->addUrl('http://www.jeroendesloovere.be'); | ||
$vcard->addUrl('http://home.example.com', 'HOME'); | ||
$vcard->addUrl('http://work1.example.com', 'PREF;WORK'); | ||
$vcard->addUrl('http://work2.example.com', 'PREF;WORK'); | ||
$parser = new VCardParser($vcard->buildVCard()); | ||
$this->assertEquals($parser->getCardAtIndex(0)->url['default'][0], 'http://example.com'); | ||
$this->assertEquals($parser->getCardAtIndex(0)->url['default'][0], 'http://www.jeroendesloovere.be'); | ||
$this->assertEquals($parser->getCardAtIndex(0)->url['HOME'][0], 'http://home.example.com'); | ||
$this->assertEquals($parser->getCardAtIndex(0)->url['PREF;WORK'][0], 'http://work1.example.com'); | ||
$this->assertEquals($parser->getCardAtIndex(0)->url['PREF;WORK'][1], 'http://work2.example.com'); | ||
|
@@ -237,15 +235,15 @@ public function testVcardDB() | |
{ | ||
$db = ''; | ||
$vcard = new VCard(); | ||
$vcard->addName("Admiraal", "Wouter"); | ||
$vcard->addName("Desloovere", "Jeroen"); | ||
$db .= $vcard->buildVCard(); | ||
|
||
$vcard = new VCard(); | ||
$vcard->addName("Lorem", "Ipsum"); | ||
$db .= $vcard->buildVCard(); | ||
|
||
$parser = new VCardParser($db); | ||
$this->assertEquals($parser->getCardAtIndex(0)->fullname, "Wouter Admiraal"); | ||
$this->assertEquals($parser->getCardAtIndex(0)->fullname, "Jeroen Desloovere"); | ||
$this->assertEquals($parser->getCardAtIndex(1)->fullname, "Ipsum Lorem"); | ||
} | ||
|
||
|
@@ -254,7 +252,7 @@ public function testIteration() | |
// Prepare a VCard DB. | ||
$db = ''; | ||
$vcard = new VCard(); | ||
$vcard->addName("Admiraal", "Wouter"); | ||
$vcard->addName("Desloovere", "Jeroen"); | ||
$db .= $vcard->buildVCard(); | ||
|
||
$vcard = new VCard(); | ||
|
@@ -263,7 +261,7 @@ public function testIteration() | |
|
||
$parser = new VCardParser($db); | ||
foreach ($parser as $i => $card) { | ||
$this->assertEquals($card->fullname, $i == 0 ? "Wouter Admiraal" : "Ipsum Lorem"); | ||
$this->assertEquals($card->fullname, $i == 0 ? "Jeroen Desloovere" : "Ipsum Lorem"); | ||
} | ||
} | ||
|
||
|
@@ -272,12 +270,12 @@ public function testFromFile() | |
$parser = VCardParser::parseFromFile(__DIR__ . '/example.vcf'); | ||
// Use this opportunity to test fetching all cards directly. | ||
$cards = $parser->getCards(); | ||
$this->assertEquals($cards[0]->firstname, "Wouter"); | ||
$this->assertEquals($cards[0]->lastname, "Admiraal"); | ||
$this->assertEquals($cards[0]->fullname, "Wouter Admiraal"); | ||
$this->assertEquals($cards[0]->firstname, "Jeroen"); | ||
$this->assertEquals($cards[0]->lastname, "Desloovere"); | ||
$this->assertEquals($cards[0]->fullname, "Jeroen Desloovere"); | ||
// Check the parsing of grouped items as well, which are present in the | ||
// example file. | ||
$this->assertEquals($cards[0]->url['default'][0], 'http://example.com'); | ||
$this->assertEquals($cards[0]->url['default'][0], 'http://www.jeroendesloovere.be'); | ||
$this->assertEquals($cards[0]->email['INTERNET'][0], '[email protected]'); | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -16,8 +16,6 @@ | |
|
||
/** | ||
* This class will test our VCard PHP Class which can generate VCards. | ||
* | ||
* @author Jeroen Desloovere <[email protected]> | ||
*/ | ||
class VCardTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|