Skip to content

fix stream assertions and avoid phpunit warnings #191

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

Merged
merged 1 commit into from
Dec 17, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/NodeTypeManagement/NodeTypeBaseCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public function testValidateCustomNodeType()

$node->setProperty('phpcr:class', ['x', 'y']);
$this->session->save();

$this->addToAssertionCount(1);
}

public function testRegisterNodeTypesNoUpdate()
Expand Down
2 changes: 2 additions & 0 deletions tests/Query/CharacterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ public function testQueryWithColon()
',
QueryInterface::JCR_SQL2
)->execute();

$this->addToAssertionCount(1);
}

public function testQueryWithAmpersand()
Expand Down
2 changes: 2 additions & 0 deletions tests/Writing/MixinReferenceableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,7 @@ public function testCreateReferenceInSingleTransaction()
$child1->setProperty('someref', $child2, PropertyType::REFERENCE);

$this->session->save();

$this->addToAssertionCount(1);
}
}
6 changes: 4 additions & 2 deletions tests/Writing/SetPropertyTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public function testCreateValueBinaryFromStream()
$oldSession = $this->session;
$this->saveAndRenewSession(); // either this
$oldSession->logout(); // or this should close the stream
$this->assertNotInternalType('resource', $stream, 'The responsibility for the stream goes into phpcr who must close it');
// phpunit assertNotInternalType type still considers the closed stream a resource
$this->assertFalse(\is_resource($stream), 'The responsibility for the stream goes into phpcr who must close it');

$bin = $this->session->getProperty('/tests_general_base/numberPropertyNode/jcr:content/newBinaryStream');
$this->assertEquals(PropertyType::BINARY, $bin->getType());
Expand All @@ -102,7 +103,8 @@ public function testCreateValueBinaryFromStreamAndRead()
$oldSession = $this->session;
$this->saveAndRenewSession(); // either this
$oldSession->logout(); // or this should close the stream
$this->assertNotInternalType('resource', $stream, 'The responsibility for the stream goes into phpcr who must close it');
// phpunit assertNotInternalType type still considers the closed stream a resource
$this->assertFalse(\is_resource($stream), 'The responsibility for the stream goes into phpcr who must close it');

$bin = $this->session->getProperty('/tests_general_base/numberPropertyNode/jcr:content/newBinaryStream');
$this->assertEquals(PropertyType::BINARY, $bin->getType());
Expand Down