Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

#418 Saving and Resaving #497

Closed
wants to merge 1 commit into from

3 participants

@nymo

Created test for triggering array to string conversion for isse in #418

Explanation:
I tried to trigger the notice warning and created a test case similar to the example of @harikt . I was unable to trigger the notice warning so for me it looks like there is no bug as described by harikt or I misunderstood the problem.

@nymo nymo Propel2-418 Saving and Resaving
-created test for triggering array to string conversion
e7c2f0e
@harikt

@nymo Thank you.

I tried some months back for a fun project. Not having the development tools now to look back.

But it was having the errors at that time.

Thanks

@harikt

I digged where it was . You can see at https://github.com/harikt/Hari.Sample/blob/a4b40be3a9b8127a92b8ebda4efa38ffe2d85b8f/src/Hari/Sample/Web/Post/Page.php#L113 built as an example for @auraphp , so you may need to create the project first.

Thanks

@nymo

@harikt
I build your project and created a post with some tags on my local machine and got no errors or notice warnings.
From my side #418 seems to be fixed. Maybe you want to double check and recreate your project?

@harikt

nope. Thanks for your works.

@willdurand willdurand closed this
@marcj marcj referenced this pull request
Closed

Saving and Resaving #418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 3, 2013
  1. @nymo

    Propel2-418 Saving and Resaving

    nymo authored
    -created test for triggering array to string conversion
This page is out of date. Refresh to see the latest.
Showing with 75 additions and 0 deletions.
  1. +75 −0 tests/Propel/Tests/Issues/Issue418Test.php
View
75 tests/Propel/Tests/Issues/Issue418Test.php
@@ -0,0 +1,75 @@
+<?php
+
+/**
+ * This file is part of the Propel package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\Tests;
+
+use Propel\Runtime\Collection\ObjectCollection;
+use Propel\Tests\Bookstore\Author;
+use Propel\Tests\Bookstore\Book;
+use Propel\Tests\Bookstore\BookClubList;
+use Propel\Tests\Bookstore\BookQuery;
+use Propel\Tests\Bookstore\Publisher;
+use Propel\Tests\Helpers\Bookstore\BookstoreEmptyTestBase;
+
+
+class Issue418Test extends BookstoreEmptyTestBase
+{
+ /**
+ * @expectedException \PHPUnit_Framework_Error_Notice
+ */
+ public function testArrayToStringConversion()
+ {
+ $author = new Author();
+ $author->setFirstName("Jim");
+ $author->setLastName("Jefferson");
+ $author->save();
+
+ $pub = new Publisher();
+ $pub->setName("New Media");
+ $pub->save();
+
+ $quick = new Book();
+ $quick->setISBN("0380977427");
+ $quick->setTitle("Quicksilver");
+ $quick->setAuthor($author);
+ $quick->setPublisher($pub);
+ $quick->save();
+
+ $burt = new Book();
+ $burt->setISBN("2313131");
+ $burt->setTitle("Burton");
+ $burt->setAuthor($author);
+ $burt->setPublisher($pub);
+ $burt->save();
+
+ $list = new BookClubList();
+ $list->setTheme('Black');
+ $list->setGroupLeader('Mr. Simon');
+
+ $collBooks = new ObjectCollection();
+ $prevBooks = array('Quicksilver','Burton');
+ foreach($prevBooks as $title){
+ $collBooks->append(BookQuery::create()->filterByTitle($title)->findOneOrCreate());
+ }
+
+ $list->setBooks($collBooks);
+ $list->save();
+
+ $collection = BookQuery::create()->findByTitle($prevBooks);
+
+ foreach($collection as $book){
+ $postBooks[] = $book->getTitle();
+ }
+
+ $this->assertContains('Quicksilver',$postBooks);
+ $this->assertContains('Burton',$postBooks);
+ }
+
+}
Something went wrong with that request. Please try again.