Skip to content

Commit

Permalink
Merge pull request #122 from wmde/publicrecord
Browse files Browse the repository at this point in the history
Use publicRecord instead of name field for comment user name display
  • Loading branch information
manicki committed Feb 8, 2016
2 parents 33690e8 + f2bfae5 commit 52522d9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/DataAccess/DbalCommentRepository.php
Expand Up @@ -32,7 +32,7 @@ public function getPublicComments( int $limit ): array {
return array_map(
function( Donation $donation ) {
return Comment::newInstance()
->setAuthorName( $donation->getName() )
->setAuthorName( $donation->getPublicRecord() )
->setCommentText( $donation->getComment() )
->setDonationAmount( (float)$donation->getAmount() )
->setPostingTime( $donation->getDtNew() )
Expand Down
10 changes: 5 additions & 5 deletions tests/Integration/DataAccess/DbalCommentRepositoryTest.php
Expand Up @@ -114,7 +114,7 @@ public function testOnlyNonDeletedCommentsGetReturned() {

private function persistFirstComment() {
$firstDonation = new Donation();
$firstDonation->setName( 'First name' );
$firstDonation->setPublicRecord( 'First name' );
$firstDonation->setComment( 'First comment' );
$firstDonation->setAmount( '100' );
$firstDonation->setDtNew( new DateTime( '1984-01-01' ) );
Expand All @@ -124,7 +124,7 @@ private function persistFirstComment() {

private function persistSecondComment() {
$secondDonation = new Donation();
$secondDonation->setName( 'Second name' );
$secondDonation->setPublicRecord( 'Second name' );
$secondDonation->setComment( 'Second comment' );
$secondDonation->setAmount( '200' );
$secondDonation->setDtNew( new DateTime( '1984-02-02' ) );
Expand All @@ -134,7 +134,7 @@ private function persistSecondComment() {

private function persistThirdComment() {
$thirdDonation = new Donation();
$thirdDonation->setName( 'Third name' );
$thirdDonation->setPublicRecord( 'Third name' );
$thirdDonation->setComment( 'Third comment' );
$thirdDonation->setAmount( '300' );
$thirdDonation->setDtNew( new DateTime( '1984-03-03' ) );
Expand All @@ -144,7 +144,7 @@ private function persistThirdComment() {

private function persistPrivateComment() {
$privateDonation = new Donation();
$privateDonation->setName( 'Private name' );
$privateDonation->setPublicRecord( 'Private name' );
$privateDonation->setComment( 'Private comment' );
$privateDonation->setAmount( '1337' );
$privateDonation->setDtNew( new DateTime( '1984-12-12' ) );
Expand All @@ -154,7 +154,7 @@ private function persistPrivateComment() {

private function persistDeletedComment() {
$deletedDonation = new Donation();
$deletedDonation->setName( 'Deleted name' );
$deletedDonation->setPublicRecord( 'Deleted name' );
$deletedDonation->setComment( 'Deleted comment' );
$deletedDonation->setAmount( '31337' );
$deletedDonation->setDtNew( new DateTime( '1984-11-11' ) );
Expand Down
6 changes: 3 additions & 3 deletions tests/System/Routes/ListCommentsHtmlRouteTest.php
Expand Up @@ -51,7 +51,7 @@ private function newClientWithThreeComments(): Client {

private function persistFirstComment( EntityManager $entityManager ) {
$firstDonation = new Donation();
$firstDonation->setName( 'First name' );
$firstDonation->setPublicRecord( 'First name' );
$firstDonation->setComment( 'First comment' );
$firstDonation->setAmount( '100.42' );
$firstDonation->setDtNew( new DateTime( '1984-01-01' ) );
Expand All @@ -61,7 +61,7 @@ private function persistFirstComment( EntityManager $entityManager ) {

private function persistSecondComment( EntityManager $entityManager ) {
$secondDonation = new Donation();
$secondDonation->setName( 'Second name' );
$secondDonation->setPublicRecord( 'Second name' );
$secondDonation->setComment( 'Second comment' );
$secondDonation->setAmount( '9001' );
$secondDonation->setDtNew( new DateTime( '1984-02-02' ) );
Expand All @@ -71,7 +71,7 @@ private function persistSecondComment( EntityManager $entityManager ) {

private function persistEvilComment( EntityManager $entityManager ) {
$secondDonation = new Donation();
$secondDonation->setName( 'Third name & company' );
$secondDonation->setPublicRecord( 'Third name & company' );
$secondDonation->setComment( 'Third <script> comment' );
$secondDonation->setAmount( '9001' );
$secondDonation->setDtNew( new DateTime( '1984-02-02' ) );
Expand Down
4 changes: 2 additions & 2 deletions tests/System/Routes/ListCommentsJsonRouteTest.php
Expand Up @@ -63,7 +63,7 @@ public function testRouteShowsComments() {

private function persistFirstComment( EntityManager $entityManager ) {
$firstDonation = new Donation();
$firstDonation->setName( 'First name' );
$firstDonation->setPublicRecord( 'First name' );
$firstDonation->setComment( 'First comment' );
$firstDonation->setAmount( '100' );
$firstDonation->setDtNew( new DateTime( '1984-01-01' ) );
Expand All @@ -73,7 +73,7 @@ private function persistFirstComment( EntityManager $entityManager ) {

private function persistSecondComment( EntityManager $entityManager ) {
$secondDonation = new Donation();
$secondDonation->setName( 'Second name' );
$secondDonation->setPublicRecord( 'Second name' );
$secondDonation->setComment( 'Second comment' );
$secondDonation->setAmount( '200' );
$secondDonation->setDtNew( new DateTime( '1984-02-02' ) );
Expand Down
6 changes: 3 additions & 3 deletions tests/System/Routes/ListCommentsRssRouteTest.php
Expand Up @@ -74,7 +74,7 @@ public function testWhenAreComments_theyAreInTheRss() {

private function persistFirstComment( EntityManager $entityManager ) {
$firstDonation = new Donation();
$firstDonation->setName( 'First name' );
$firstDonation->setPublicRecord( 'First name' );
$firstDonation->setComment( 'First comment' );
$firstDonation->setAmount( '100.42' );
$firstDonation->setDtNew( new DateTime( '1984-01-01' ) );
Expand All @@ -84,7 +84,7 @@ private function persistFirstComment( EntityManager $entityManager ) {

private function persistSecondComment( EntityManager $entityManager ) {
$secondDonation = new Donation();
$secondDonation->setName( 'Second name' );
$secondDonation->setPublicRecord( 'Second name' );
$secondDonation->setComment( 'Second comment' );
$secondDonation->setAmount( '9001' );
$secondDonation->setDtNew( new DateTime( '1984-02-02' ) );
Expand All @@ -94,7 +94,7 @@ private function persistSecondComment( EntityManager $entityManager ) {

private function persistEvilComment( EntityManager $entityManager ) {
$secondDonation = new Donation();
$secondDonation->setName( 'Third name & company' );
$secondDonation->setPublicRecord( 'Third name & company' );
$secondDonation->setComment( 'Third <script> comment' );
$secondDonation->setAmount( '9001' );
$secondDonation->setDtNew( new DateTime( '1984-02-02' ) );
Expand Down

0 comments on commit 52522d9

Please sign in to comment.