fix a bug I introduced into 0.5.0 + added unittests & updated docs #6

Open
wants to merge 18 commits into
from

Conversation

Projects
None yet
5 participants
Contributor

bkdotcom commented Aug 17, 2012

whew - phpUnit's documentation is sorely lacking in the how to install and run your first test department.
I apologize for the delay.

Most importantly, I discovered that I broke all the add*() methods.
addEmail('user@domain.com');
addEmail('foo@bar.com'); // oops, this is now overwriting the 1st, rather than adding an iteration
I have updated Build/Vcard.php to fix this.

I also need to add a file to the repository (a small image to the tests dir) for testing set('PHOTO') and/or set('LOGO').
apparently this can't be done via the web interface, I will need to add from home.

bkdotcom added some commits Aug 17, 2012

@bkdotcom bkdotcom Update File/IMC/Build/Vcard.php
Oops
I broke all the add*() methods such that they only set the first iteration
addEmail('user1@test.com');
addEmail('user2@test.com');   // should not be overwriting the above!
b463383
@bkdotcom bkdotcom Update tests/AllTests.php a8edc55
@bkdotcom bkdotcom Update tests/File/IMC/BuildTest.php
tests set() for all standard properties and tests all add*() and set*() methods.     tests still need to be created to test that get() / fetch() return properly escaped and encoded strings
28a0f10
@bkdotcom bkdotcom Update tests/File/IMC/ParseTest.php
completed the testPropertyGroups and testParameters   tests
e07f99f
@bkdotcom bkdotcom Update docs/vcalendar_parse_example.php b6f9b42
@bkdotcom bkdotcom Update docs/vcard_build_example.php
now uses the set() method
f12f81b
@bkdotcom bkdotcom Update docs/vcard_parse_example.php 73c36c7
@bkdotcom bkdotcom Update docs/contact_vcard_build.html
not sure where this is seen/used... updated examples to use the new set() method
39a3b1d

This pull request passes (merged 39a3b1d into 36d31ea).

This pull request passes (merged 410e4d8 into 36d31ea).

till was assigned Aug 18, 2012

This pull request passes (merged e4a7a20 into 36d31ea).

This pull request passes (merged 4eabd3f into 36d31ea).

Owner

till commented Aug 22, 2012

I will take a look tomorrow – thanks for helping! :)

@CloCkWeRX CloCkWeRX commented on an outdated diff Jan 28, 2013

File/IMC/Build/Vcard.php
}
/**
* @deprecated
* @see self::set()
*/
- public function addOrganization($val) {
+ public function addOrganization($val,$append=true) {
+ if ( $append && !empty($this->value['ORG'][0]) )
@CloCkWeRX

CloCkWeRX Jan 28, 2013

Owner

Spaces / coding style here - Run PHPCS over the code.

@CloCkWeRX CloCkWeRX commented on an outdated diff Jan 28, 2013

File/IMC/Build/Vcard.php
@@ -763,7 +780,7 @@ public function addOrganization($val) {
* @see self::set()
*/
public function addTelephone($val) {
- return $this->set('TEL',$val);
+ return $this->set('TEL',$val,'new');
@CloCkWeRX

CloCkWeRX Jan 28, 2013

Owner

Style (I know what is there is not right, but it's better to fix it)

bkdotcom added some commits Apr 4, 2013

@bkdotcom bkdotcom Update Build.php
after running phpCS
7a28607
@bkdotcom bkdotcom Update Parse.php
after running phpCS
c73d558
@bkdotcom bkdotcom Update Vcard.php
after running phpCS
c472204
@bkdotcom bkdotcom Update Vcard.php
after running phpCS
3caf72d
Contributor

bkdotcom commented Apr 4, 2013

I'm still not gitHub proficient, but I've updated 4 files to make phpCS mostly happy (at least happy concerning any edits I've made). Let me know if the updates aren't part of my open pull request. Or if I need to to do anything else.
thanks

I was wondering about that... the "new" in the depreciate methods was something I was going to add until I looked at this fix. Going to try it out.

Owner

till commented Feb 17, 2014

@generalredneck @bkdotcom What should we do here?

Contributor

bkdotcom commented Feb 18, 2014

I believe @generalredneck is is saying all is well. and this fix is Ready to be Tested By the Community

Owner

till commented Feb 27, 2014

@generalredneck @bkdotcom Can either of you help my merging master into this?

bkdotcom added some commits Sep 1, 2016

@bkdotcom bkdotcom Merge remote-tracking branch 'refs/remotes/pear/master'
# Conflicts:
#	File/IMC/Build.php
#	tests/AllTests.php
0e031c5
@bkdotcom bkdotcom tests 96e25ac
@bkdotcom bkdotcom PHPUnit updates + .gitattributes
phpunit updates & whitespace

added .gitattributes: "* text eol=lf"
test was failing due to line-ending conversion
0099650
Contributor

bkdotcom commented Sep 1, 2016

2.5 years later...
master has been merged into this pull-request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment