Skip to content

Instantly share code, notes, and snippets.

@sdklab007
Forked from briankip/phpunit-assertions.md
Created October 2, 2020 08:36
Show Gist options
  • Save sdklab007/e984e347f34fe3608b7b79d35163f20d to your computer and use it in GitHub Desktop.
Save sdklab007/e984e347f34fe3608b7b79d35163f20d to your computer and use it in GitHub Desktop.
A list of PHPUnit assertions
  • assertArrayHasKey
  • assertArrayNotHasKey
  • assertContains
  • assertAttributeContains
  • assertNotContains
  • assertAttributeNotContains
  • assertContainsOnly
  • assertAttributeContainsOnly
  • assertNotContainsOnly
  • assertAttributeNotContainsOnly
  • assertEquals
  • assertAttributeEquals
  • assertNotEquals
  • assertAttributeNotEquals
  • assertEmpty
  • assertAttributeEmpty
  • assertNotEmpty
  • assertAttributeNotEmpty
  • assertGreaterThan
  • assertAttributeGreaterThan
  • assertGreaterThanOrEqual
  • assertAttributeGreaterThanOrEqual
  • assertLessThan
  • assertAttributeLessThan
  • assertLessThanOrEqual
  • assertAttributeLessThanOrEqual
  • assertFileEquals
  • assertFileNotEquals
  • assertStringEqualsFile
  • assertStringNotEqualsFile
  • assertFileExists
  • assertFileNotExists
  • assertTrue
  • assertFalse
  • assertNotNull
  • assertNull
  • assertClassHasAttribute
  • assertClassNotHasAttribute
  • assertClassHasStaticAttribute
  • assertClassNotHasStaticAttribute
  • assertObjectHasAttribute
  • assertObjectNotHasAttribute
  • assertSame
  • assertAttributeSame
  • assertNotSame
  • assertAttributeNotSame
  • assertInstanceOf
  • assertAttributeInstanceOf
  • assertNotInstanceOf
  • assertAttributeNotInstanceOf
  • assertInternalType
  • assertAttributeInternalType
  • assertNotInternalType
  • assertAttributeNotInternalType
  • assertType
  • assertAttributeType
  • assertNotType
  • assertAttributeNotType
  • assertRegExp
  • assertNotRegExp
  • assertStringMatchesFormat
  • assertStringNotMatchesFormat
  • assertStringMatchesFormatFile
  • assertStringNotMatchesFormatFile
  • assertStringStartsWith
  • assertStringStartsNotWith
  • assertStringEndsWith
  • assertStringEndsNotWith
  • assertXmlFileEqualsXmlFile
  • assertXmlFileNotEqualsXmlFile
  • assertXmlStringEqualsXmlFile
  • assertXmlStringNotEqualsXmlFile
  • assertXmlStringEqualsXmlString
  • assertXmlStringNotEqualsXmlString
  • assertEqualXMLStructure
  • assertSelectCount
  • assertSelectRegExp
  • assertSelectEquals
  • assertTag
  • assertNotTag
  • assertThat
  • logicalAnd
  • logicalOr
  • logicalNot
  • logicalXor
  • anything
  • isTrue
  • isFalse
  • isNull
  • attribute
  • contains
  • containsOnly
  • arrayHasKey
  • equalTo
  • attributeEqualTo
  • isEmpty
  • fileExists
  • greaterThan
  • greaterThanOrEqual
  • classHasAttribute
  • classHasStaticAttribute
  • objectHasAttribute
  • identicalTo
  • isInstanceOf
  • isType
  • lessThan
  • lessThanOrEqual
  • matchesRegularExpression
  • matches
  • stringStartsWith
  • stringContains
  • stringEndsWith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment