Bring fluid interface to Feed Writer #2694

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@bakura10
Contributor
bakura10 commented Oct 6, 2012

This PR brings fluid interface to Feed writer.

Owner

Could you please add unit tests for the fluent interface? Also, you evidently need to rebase.

Thanks!

@weierophinney weierophinney was assigned Oct 8, 2012
Contributor
bakura10 commented Oct 8, 2012

Unit test for fluent interface ? Just check that the value returned is the same as the original object ?

I can do that.

Owner

Yes, exactly. You can actually test all methods that implement a fluent interface at once -- simply chain all the calls, and verify you receive an instance of the original class.

Contributor

Done.

@weierophinney weierophinney commented on the diff Oct 16, 2012
tests/ZendTest/Feed/Writer/FeedTest.php
+ ->addHub('foo')
+ ->addHubs(array('foo'))
+ ->setBaseUrl('http://www.example.com')
+ ->setDateCreated(null)
+ ->setDateModified(null)
+ ->setDescription('description')
+ ->setEncoding('utf-8')
+ ->setId('1')
+ ->setImage(array('uri' => 'http://www.example.com'))
+ ->setLanguage('fr')
+ ->setLastBuildDate(null)
+ ->setLink('foo')
+ ->setTitle('foo')
+ ->setType('foo');
+
+ $this->assertEquals($return, $writer);
weierophinney
weierophinney Oct 16, 2012 Owner

This should be assertSame() -- assertEquals() can compare two objects for equality, without them being the same object. I'll update this on merge.

@weierophinney weierophinney added a commit that referenced this pull request Oct 16, 2012
@weierophinney weierophinney [#2694] use assertSame
- Test for same object, not equality of objects, when testing fluent
  interface
25aaf9d
@weierophinney weierophinney added a commit that referenced this pull request Oct 16, 2012
@weierophinney weierophinney Merge branch 'hotfix/2694' into develop
Forward port #2694
753054a
@weierophinney weierophinney added a commit that closed this pull request Oct 16, 2012
@weierophinney weierophinney Merge branch 'hotfix/2694'
Close #2694
1c726ff
@weierophinney weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
@weierophinney weierophinney [zendframework/zendframework#2694] use assertSame
- Test for same object, not equality of objects, when testing fluent
  interface
8e7fa2d
@weierophinney weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/2694' d08629f
@weierophinney weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/2694' into develop 4179b4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment