Skip to content

Commit

Permalink
#62: Fix calls to deprecated phpunit assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfranco committed Aug 8, 2024
1 parent 236fbf4 commit 80064fd
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion application/test/Catalog/Action/Helper/OsidIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testGetStringFromOsidId()
{
$id = new phpkit_id_Id('example.edu', 'urn', '123456789/abcd');
$idString = $this->osidIdHelper->toString($id);
$this->assertInternalType('string', $idString);
$this->assertIsString($idString);

$newId = $this->osidIdHelper->fromString($idString);
$this->assertEquals($idString, $this->osidIdHelper->toString($newId));
Expand Down
4 changes: 2 additions & 2 deletions application/test/Catalog/Action/Helper/OsidTopicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testTopicListAsArray()
$topics = $this->topicLookup->getTopics();
$numTopics = $topics->available();
$topicArray = $this->osidTopicHelper->topicListAsArray($topics);
$this->assertInternalType('array', $topicArray);
$this->assertIsArray($topicArray);
$this->assertEquals($numTopics, count($topicArray));
$this->assertInstanceOf('osid_course_Topic', $topicArray[0]);
}
Expand All @@ -66,7 +66,7 @@ public function testFilterTopicsByType()
$subjectType = new phpkit_type_URNInetType("urn:inet:middlebury.edu:genera:topic/subject");

$filteredTopics = $this->osidTopicHelper->filterTopicsByType($topicArray, $subjectType);
$this->assertInternalType('array', $filteredTopics);
$this->assertIsArray($filteredTopics);
$this->assertLessThan($numTopics, count($filteredTopics));
$this->assertEquals(4, count($filteredTopics));
$this->assertInstanceOf('osid_course_Topic', $filteredTopics[0]);
Expand Down
2 changes: 1 addition & 1 deletion application/test/Catalog/Action/Helper/OsidTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testGetStringFromOsidType()
{
$type = new phpkit_type_Type('urn', 'example.edu', '123456789/abcd');
$typeString = $this->osidTypeHelper->toString($type);
$this->assertInternalType('string', $typeString);
$this->assertIsString($typeString);

$newType = $this->osidTypeHelper->fromString($typeString);
$this->assertEquals($typeString, $this->osidTypeHelper->toString($newType));
Expand Down
10 changes: 5 additions & 5 deletions application/test/banner/course/Course/Search/SearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function tearDown(): void
*/
public function testGetLimitClause()
{
$this->assertInternalType('string', $this->object->getLimitClause());
$this->assertIsString($this->object->getLimitClause());
$this->assertEquals('', $this->object->getLimitClause());
}

Expand All @@ -81,7 +81,7 @@ public function testGetLimitClause()
*/
public function testGetOrderByClause()
{
$this->assertInternalType('string', $this->object->getOrderByClause());
$this->assertIsString($this->object->getOrderByClause());
$this->assertEquals('', $this->object->getOrderByClause());
}

Expand All @@ -90,7 +90,7 @@ public function testGetOrderByClause()
*/
public function testGetWhereClause()
{
$this->assertInternalType('string', $this->object->getWhereClause());
$this->assertIsString($this->object->getWhereClause());
$this->assertEquals('', $this->object->getWhereClause());
}

Expand All @@ -99,7 +99,7 @@ public function testGetWhereClause()
*/
public function testGetAdditionalTableJoins()
{
$this->assertInternalType('array', $this->object->getAdditionalTableJoins());
$this->assertIsArray($this->object->getAdditionalTableJoins());
$this->assertEquals(0, count($this->object->getAdditionalTableJoins()));

}
Expand All @@ -109,7 +109,7 @@ public function testGetAdditionalTableJoins()
*/
public function testGetParameters()
{
$this->assertInternalType('array', $this->object->getParameters());
$this->assertIsArray($this->object->getParameters());
$this->assertEquals(0, count($this->object->getParameters()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function tearDown(): void
*/
public function testGetOrderByClause()
{
$this->assertInternalType('string', $this->object->getOrderByClause());
$this->assertIsString($this->object->getOrderByClause());
$this->assertEquals('', $this->object->getOrderByClause());
}

Expand All @@ -77,7 +77,7 @@ public function testGetOrderByClause()
*/
public function testGetAdditionalTableJoins()
{
$this->assertInternalType('array', $this->object->getAdditionalTableJoins());
$this->assertIsArray($this->object->getAdditionalTableJoins());
$this->assertEquals(0, count($this->object->getAdditionalTableJoins()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ protected function tearDown(): void
*/
public function testGetWhereClause()
{
$this->assertInternalType('string', $this->object->getWhereClause());
$this->assertIsString($this->object->getWhereClause());
}

/**
*
*/
public function testGetAdditionalTableJoins()
{
$this->assertInternalType('array', $this->object->getAdditionalTableJoins());
$this->assertIsArray($this->object->getAdditionalTableJoins());
}

/**
*
*/
public function testGetParameters()
{
$this->assertInternalType('array', $this->object->getParameters());
$this->assertIsArray($this->object->getParameters());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function tearDown(): void
*/
public function testGetLimitClause()
{
$this->assertInternalType('string', $this->object->getLimitClause());
$this->assertIsString($this->object->getLimitClause());
$this->assertEquals('', $this->object->getLimitClause());
}

Expand All @@ -70,7 +70,7 @@ public function testGetLimitClause()
*/
public function testGetOrderByClause()
{
$this->assertInternalType('string', $this->object->getOrderByClause());
$this->assertIsString($this->object->getOrderByClause());
$this->assertEquals('', $this->object->getOrderByClause());
}

Expand All @@ -79,7 +79,7 @@ public function testGetOrderByClause()
*/
public function testGetWhereClause()
{
$this->assertInternalType('string', $this->object->getWhereClause());
$this->assertIsString($this->object->getWhereClause());
$this->assertEquals('', $this->object->getWhereClause());
}

Expand All @@ -88,7 +88,7 @@ public function testGetWhereClause()
*/
public function testGetAdditionalTableJoins()
{
$this->assertInternalType('array', $this->object->getAdditionalTableJoins());
$this->assertIsArray($this->object->getAdditionalTableJoins());
$this->assertEquals(0, count($this->object->getAdditionalTableJoins()));

}
Expand All @@ -98,7 +98,7 @@ public function testGetAdditionalTableJoins()
*/
public function testGetParameters()
{
$this->assertInternalType('array', $this->object->getParameters());
$this->assertIsArray($this->object->getParameters());
$this->assertEquals(0, count($this->object->getParameters()));
}

Expand Down
50 changes: 25 additions & 25 deletions application/test/banner/course/CourseOfferingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testGenusType() {
*/
public function testGetTitle()
{
$this->assertInternalType('string', $this->object->getTitle());
$this->assertIsString($this->object->getTitle());
$this->assertEquals('Relativity And Quantum Physics', $this->object->getTitle());
}

Expand Down Expand Up @@ -142,7 +142,7 @@ public function testEffectiveDateDescription()
public function testChemGetNumber()
{
$object = $this->session->getCourseOffering($this->chemOfferingId);
$this->assertInternalType('string', $object->getNumber());
$this->assertIsString($object->getNumber());
$this->assertEquals('CHEM0104T-S05', $object->getNumber());
}

Expand All @@ -151,7 +151,7 @@ public function testChemGetNumber()
*/
public function testGetNumber()
{
$this->assertInternalType('string', $this->object->getNumber());
$this->assertIsString($this->object->getNumber());
$this->assertEquals('PHYS0201A-F08', $this->object->getNumber());
}

Expand All @@ -160,7 +160,7 @@ public function testGetNumber()
*/
public function testGetCredits()
{
$this->assertInternalType('float', $this->object->getCredits());
$this->assertIsFloat($this->object->getCredits());
$this->assertEquals(1.00, $this->object->getCredits());
}

Expand All @@ -169,7 +169,7 @@ public function testGetCredits()
*/
public function testGetPrereqInfo()
{
$this->assertInternalType('string', $this->object->getPrereqInfo());
$this->assertIsString($this->object->getPrereqInfo());
}

/**
Expand Down Expand Up @@ -294,7 +294,7 @@ public function testGeolTopicIds()
*/
public function testGetLocationInfo()
{
$this->assertInternalType('string', $this->object->getLocationInfo());
$this->assertIsString($this->object->getLocationInfo());
// $this->assertEquals('', $this->object->getLocationInfo());
}

Expand All @@ -303,7 +303,7 @@ public function testGetLocationInfo()
*/
public function testHasLocation()
{
$this->assertInternalType('boolean', $this->object->hasLocation());
$this->assertIsBool($this->object->hasLocation());
}

/**
Expand Down Expand Up @@ -350,7 +350,7 @@ public function testGetLocation()
*/
public function testGetScheduleInfo()
{
$this->assertInternalType('string', $this->object->getScheduleInfo());
$this->assertIsString($this->object->getScheduleInfo());
// $this->assertEquals('', $this->object->getScheduleInfo());
}

Expand All @@ -359,7 +359,7 @@ public function testGetScheduleInfo()
*/
public function testHasCalendar()
{
$this->assertInternalType('boolean', $this->object->hasCalendar());
$this->assertIsBool($this->object->hasCalendar());
}

/**
Expand Down Expand Up @@ -401,7 +401,7 @@ public function testGetCalendar()
*/
public function testHasLearningObjective()
{
$this->assertInternalType('boolean', $this->object->hasLearningObjective());
$this->assertIsBool($this->object->hasLearningObjective());
}

/**
Expand Down Expand Up @@ -443,7 +443,7 @@ public function testGetLearningObjective()
*/
public function testGetURL()
{
$this->assertInternalType('string', $this->object->getURL());
$this->assertIsString($this->object->getURL());
}

/**
Expand Down Expand Up @@ -642,7 +642,7 @@ public function testMeetsOnSunday () {
public function testGetSundayStartTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getSundayStartTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand All @@ -652,7 +652,7 @@ public function testGetSundayStartTimes () {
public function testGetSundayEndTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getSundayEndTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand All @@ -670,7 +670,7 @@ public function testMeetsOnMonday () {
public function testGetMondayStartTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getMondayStartTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(1, count($times));
$this->assertEquals(40500, $times[0]); // 11:15am
}
Expand All @@ -681,7 +681,7 @@ public function testGetMondayStartTimes () {
public function testGetMondayEndTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getMondayEndTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(1, count($times));
$this->assertEquals(43500, $times[0]); // 12:05pm
}
Expand All @@ -700,7 +700,7 @@ public function testMeetsOnTuesday () {
public function testGetTuesdayStartTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getTuesdayStartTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand All @@ -710,7 +710,7 @@ public function testGetTuesdayStartTimes () {
public function testGetTuesdayEndTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getTuesdayEndTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand All @@ -728,7 +728,7 @@ public function testMeetsOnWednesday () {
public function testGetWednesdayStartTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getWednesdayStartTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(1, count($times));
$this->assertEquals(40500, $times[0]); // 11:15am
}
Expand All @@ -739,7 +739,7 @@ public function testGetWednesdayStartTimes () {
public function testGetWednesdayEndTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getWednesdayEndTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(1, count($times));
$this->assertEquals(43500, $times[0]); // 12:05pm
}
Expand All @@ -758,7 +758,7 @@ public function testMeetsOnThursday () {
public function testGetThursdayStartTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getThursdayStartTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand All @@ -768,7 +768,7 @@ public function testGetThursdayStartTimes () {
public function testGetThursdayEndTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getThursdayEndTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand All @@ -786,7 +786,7 @@ public function testMeetsOnFriday () {
public function testGetFridayStartTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getFridayStartTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(1, count($times));
$this->assertEquals(40500, $times[0]); // 11:15am
}
Expand All @@ -797,7 +797,7 @@ public function testGetFridayStartTimes () {
public function testGetFridayEndTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getFridayEndTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(1, count($times));
$this->assertEquals(43500, $times[0]); // 12:05pm
}
Expand All @@ -816,7 +816,7 @@ public function testMeetsOnSaturday () {
public function testGetSaturdayStartTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getSaturdayStartTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand All @@ -826,7 +826,7 @@ public function testGetSaturdayStartTimes () {
public function testGetSaturdayEndTimes () {
$record = $this->object->getCourseOfferingRecord($this->weeklyScheduleType);
$times = $record->getSaturdayEndTimes();
$this->assertInternalType('array', $times);
$this->assertIsArray($times);
$this->assertEquals(0, count($times));
}

Expand Down
Loading

0 comments on commit 80064fd

Please sign in to comment.