Skip to content

Commit

Permalink
Use new PropelObjectWrapper::fromObject.
Browse files Browse the repository at this point in the history
  • Loading branch information
JASchilz committed Oct 14, 2016
1 parent 821aef1 commit aab4fa3
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions test/PropelObjectWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class PropelObjectWrapperTest extends PHPUnit_Framework_TestCase
{
public function testGetPascalCasedObjectName()
{
$wrappedTestClass = new PropelObjectWrapper(new TestClass());
$wrappedTestClassTwo = new PropelObjectWrapper(new TestClassTwo());
$wrappedParentClass = new PropelObjectWrapper(new ParentClass());
$wrappedChildClass = new PropelObjectWrapper(new ChildClass());
$wrappedTestClass = PropelObjectWrapper::fromObject(new TestClass());
$wrappedTestClassTwo = PropelObjectWrapper::fromObject(new TestClassTwo());
$wrappedParentClass = PropelObjectWrapper::fromObject(new ParentClass());
$wrappedChildClass = PropelObjectWrapper::fromObject(new ChildClass());

$this->assertEquals("TestClass", $wrappedTestClass->getPascalCasedObjectName());
$this->assertEquals("TestClassTwo", $wrappedTestClassTwo->getPascalCasedObjectName());
Expand All @@ -29,10 +29,10 @@ public function testGetPascalCasedObjectName()

public function testGetTitleCasedObjectName()
{
$wrappedTestClass = new PropelObjectWrapper(new TestClass());
$wrappedTestClassTwo = new PropelObjectWrapper(new TestClassTwo());
$wrappedParentClass = new PropelObjectWrapper(new ParentClass());
$wrappedChildClass = new PropelObjectWrapper(new ChildClass());
$wrappedTestClass = PropelObjectWrapper::fromObject(new TestClass());
$wrappedTestClassTwo = PropelObjectWrapper::fromObject(new TestClassTwo());
$wrappedParentClass = PropelObjectWrapper::fromObject(new ParentClass());
$wrappedChildClass = PropelObjectWrapper::fromObject(new ChildClass());

$this->assertEquals("Test Class", $wrappedTestClass->getTitleCasedObjectName());
$this->assertEquals("Test Class Two", $wrappedTestClassTwo->getTitleCasedObjectName());
Expand All @@ -42,10 +42,10 @@ public function testGetTitleCasedObjectName()

public function testGetQualifiedPascalCasedColumnNames()
{
$wrappedTestClass = new PropelObjectWrapper(new TestClass());
$wrappedTestClassTwo = new PropelObjectWrapper(new TestClassTwo());
$wrappedParentClass = new PropelObjectWrapper(new ParentClass());
$wrappedChildClass = new PropelObjectWrapper(new ChildClass());
$wrappedTestClass = PropelObjectWrapper::fromObject(new TestClass());
$wrappedTestClassTwo = PropelObjectWrapper::fromObject(new TestClassTwo());
$wrappedParentClass = PropelObjectWrapper::fromObject(new ParentClass());
$wrappedChildClass = PropelObjectWrapper::fromObject(new ChildClass());

/** TestClass */
$this->assertEquals(
Expand Down Expand Up @@ -98,10 +98,10 @@ public function testGetQualifiedPascalCasedColumnNames()

public function testGetUnqualifiedPascalCasedColumnNames()
{
$wrappedTestClass = new PropelObjectWrapper(new TestClass());
$wrappedTestClassTwo = new PropelObjectWrapper(new TestClassTwo());
$wrappedParentClass = new PropelObjectWrapper(new ParentClass());
$wrappedChildClass = new PropelObjectWrapper(new ChildClass());
$wrappedTestClass = PropelObjectWrapper::fromObject(new TestClass());
$wrappedTestClassTwo = PropelObjectWrapper::fromObject(new TestClassTwo());
$wrappedParentClass = PropelObjectWrapper::fromObject(new ParentClass());
$wrappedChildClass = PropelObjectWrapper::fromObject(new ChildClass());

/** TestClass */
$this->assertEquals(
Expand Down Expand Up @@ -153,10 +153,10 @@ public function testGetUnqualifiedPascalCasedColumnNames()

public function testGetQualifiedTitleCasedColumnNames()
{
$wrappedTestClass = new PropelObjectWrapper(new TestClass());
$wrappedTestClassTwo = new PropelObjectWrapper(new TestClassTwo());
$wrappedParentClass = new PropelObjectWrapper(new ParentClass());
$wrappedChildClass = new PropelObjectWrapper(new ChildClass());
$wrappedTestClass = PropelObjectWrapper::fromObject(new TestClass());
$wrappedTestClassTwo = PropelObjectWrapper::fromObject(new TestClassTwo());
$wrappedParentClass = PropelObjectWrapper::fromObject(new ParentClass());
$wrappedChildClass = PropelObjectWrapper::fromObject(new ChildClass());

/** TestClass */
$this->assertEquals(
Expand Down Expand Up @@ -209,10 +209,10 @@ public function testGetQualifiedTitleCasedColumnNames()

public function testGetUnqualifiedTitleCasedColumnNames()
{
$wrappedTestClass = new PropelObjectWrapper(new TestClass());
$wrappedTestClassTwo = new PropelObjectWrapper(new TestClassTwo());
$wrappedParentClass = new PropelObjectWrapper(new ParentClass());
$wrappedChildClass = new PropelObjectWrapper(new ChildClass());
$wrappedTestClass = PropelObjectWrapper::fromObject(new TestClass());
$wrappedTestClassTwo = PropelObjectWrapper::fromObject(new TestClassTwo());
$wrappedParentClass = PropelObjectWrapper::fromObject(new ParentClass());
$wrappedChildClass = PropelObjectWrapper::fromObject(new ChildClass());

/** TestClass */
$this->assertEquals(
Expand Down Expand Up @@ -265,7 +265,7 @@ public function testGetUnqualifiedTitleCasedColumnNames()
public function testGetFields()
{
$testClass = new TestClass();
$wrappedTestClass = new PropelObjectWrapper($testClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($testClass);

$values = [
'TestClass.Id' => null,
Expand Down Expand Up @@ -317,7 +317,7 @@ public function testGetFields()
public function testGetValues()
{
$testClass = new TestClass();
$wrappedTestClass = new PropelObjectWrapper($testClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($testClass);

$values = [
'TestClass.Id' => null,
Expand All @@ -342,7 +342,7 @@ public function testGetValues()
public function testGetValuesWithInheritance()
{
$childClass = new ChildClass();
$wrappedTestClass = new PropelObjectWrapper($childClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($childClass);

$values = [
'ChildClass.Id' => null,
Expand All @@ -362,7 +362,7 @@ public function testGetValuesWithInheritance()
public function testGetPrimaryKey()
{
$testClass = $this->createMock(TestClass::class);
$wrappedTestClass = new PropelObjectWrapper($testClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($testClass);

$testClass->expects($this->once())->method('getPrimaryKey');

Expand All @@ -372,7 +372,7 @@ public function testGetPrimaryKey()
public function testFillFromFields()
{
$testClass = new TestClass();
$wrappedTestClass = new PropelObjectWrapper($testClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($testClass);

$values = [
'TestClass.Id' => null,
Expand Down Expand Up @@ -401,7 +401,7 @@ public function testFillFromFields()
public function testSave()
{
$testClass = $this->createMock(TestClass::class);
$wrappedTestClass = new PropelObjectWrapper($testClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($testClass);

$testClass->expects($this->once())->method('save');

Expand All @@ -411,7 +411,7 @@ public function testSave()
public function testDelete()
{
$testClass = $this->createMock(TestClass::class);
$wrappedTestClass = new PropelObjectWrapper($testClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($testClass);

$testClass->expects($this->once())->method('delete');

Expand All @@ -421,7 +421,7 @@ public function testDelete()
public function testToString()
{
$testClass = $this->createMock(TestClass::class);
$wrappedTestClass = new PropelObjectWrapper($testClass);
$wrappedTestClass = PropelObjectWrapper::fromObject($testClass);

$testClass->method('__toString')->willReturn('');

Expand Down

0 comments on commit aab4fa3

Please sign in to comment.