Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use publicRecord instead of name field for comment user name display #122

Merged
merged 1 commit into from Feb 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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