#
# Inspect, tools to inspect a kmom.
#
# Usage: dbwebb inspect kmom01
#
# Sequence executed:
# oophp(), oophpkmom01(), oophplast()
#


#
# Test oophp general
#
oophp()
{
    inspectIntro
}



#
# Test general, last in sequence
#
oophplast()
{
    inspectMe "me/redovisa" "" "" "" "redovisa"
    local path="me/redovisa"
    fileIsReadable "$path/github.txt"
}



#
# Check details on the repo
#
function oophprepo()
{
    local repo="$1"
    local target="me/$repo"
    
    headerForTest "-- Repo $repo" "-- ${DBW_WWW}$DBW_COURSE/$target" 
    printUrl "" "$target"  

    isGitRepo "$target"
    hasGitTagBetween "$EXEC_DIR/$repo" "$2" "$3"

    inspectCommand "" "$EXEC_DIR/$repo" "git remote -v" ""
    inspectCommand "" "$EXEC_DIR/$repo" "git tag" ""
    inspectCommand "" "$EXEC_DIR/$repo" "git status" ""
    inspectCommand "" "$EXEC_DIR/$repo" "git log -n 20 --pretty=format:\"%h_%ad_:_%s%d_[%an]\" --graph --date=short" ""

    #inspectCommand "" "$EXEC_DIR/$repo" "git stash" ""
    #inspectCommand "" "$EXEC_DIR/$repo" "git checkout -b inspect $tag" ""

    # All repos does not include make test
    # Make test need test environment
    #inspectCommand "Makefile" "$EXEC_DIR/$repo" "make install test" ""
}



#
# Test oophp kmom01
#
oophpkmom01()
{
    #oophprepo "redovisa" "1.0.0" "2.0.0"

    local assignment="guess"
    inspectExerciseHeader "$assignment" "kurser/oophp/$KMOM#uppgifter" "$KMOM/$assignment"
    printUrl "" "me/$KMOM/$assignment"
    local path="me/$KMOM/$assignment"
    fileIsReadable "$path/src/Guess.php"
    fileIsReadable "$path/src/GuessException.php"
    fileIsReadable "$path/config.php"
    fileIsReadable "$path/autoload.php"
    #fileIsReadable "$path/index_get.php"
    #fileIsReadable "$path/index_post.php"
    #fileIsReadable "$path/index_session.php"
    fileIsReadable "$path/index.php"

    local assignment="guide"
    inspectExerciseHeader "$assignment" "kurser/oophp/$KMOM#uppgifter" "$assignment"
    printUrl "" "me/$assignment"
    local path="me/$assignment"
    fileIsReadable "$path/config.php"
    fileIsReadable "$path/autoload.php"
    fileIsReadable "$path/index_hello.php"
    fileIsReadable "$path/index_error.php"
    fileIsReadable "$path/index_exception.php"
    fileIsReadable "$path/index_stdclass.php"
    fileIsReadable "$path/index_person1.php"
    fileIsReadable "$path/index_person2.php"
    fileIsReadable "$path/index_setters.php"
    fileIsReadable "$path/index_constructor.php"
    fileIsReadable "$path/index_autoload.php"
    fileIsReadable "$path/index_exception_own.php"
    fileIsReadable "$path/index_session.php"
    fileIsReadable "$path/index_session_destroy.php"
    fileIsReadable "$path/src/Person1.php"
    fileIsReadable "$path/src/Person2.php"
    fileIsReadable "$path/src/Person3.php"
    fileIsReadable "$path/src/Person4.php"
    fileIsReadable "$path/src/Person5.php"
    fileIsReadable "$path/src/PersonAgeException.php"
}



#
# Test oophp kmom02
#
oophpkmom02()
{
    #oophprepo "redovisa" "2.0.0" "3.0.0"

    local assignment="guide"
    inspectExerciseHeader "$assignment" "kurser/oophp/$KMOM#uppgifter" "$assignment"
    printUrl "" "me/$assignment"
    local path="me/$assignment"
    #fileIsReadable "$path/css/style.css"
    fileIsReadable "$path/style.css"
    #fileIsReadable "$path/img/dice-faces.jpg"
    fileIsReadable "$path/dice-faces.jpg"
    fileIsReadable "$path/autoload_namespace.php"
    fileIsReadable "$path/index_namespace.php"
    fileIsReadable "$path/index_dice.php"
    fileIsReadable "$path/index_dicehand.php"
    fileIsReadable "$path/index_dicegraphic.php"
    fileIsReadable "$path/src/Person/Person.php"
    fileIsReadable "$path/src/Dice/Dice.php"
    fileIsReadable "$path/src/Dice/DiceHand.php"
    fileIsReadable "$path/src/Dice/DiceGraphic.php"
}



#
# Test oophp kmom03
#
oophpkmom03()
{
    #oophprepo "redovisa" "3.0.0" "4.0.0"

    local assignment="phpunit"
    inspectExerciseHeader "$assignment" "kurser/oophp/$KMOM#uppgifter" "$KMOM/$assignment"
    local path="me/$KMOM/$assignment"
    fileIsReadable "$path/Makefile"
    #inspectCommand "Makefile" "$EXEC_DIR/$KMOM/$assignment" "make install test"

    # Files related to me/redovisa
    fileIsReadable "me/redovisa/doc/class/dice100.pdf"
    fileIsReadable "me/redovisa/doc/class/codecoverage.png"
}



#
# Test oophp kmom04
#
oophpkmom04()
{
    #oophprepo "redovisa" "4.0.0" "5.0.0"

    local assignment="guide"
    inspectExerciseHeader "$assignment" "kurser/oophp/$KMOM#uppgifter" "$assignment"
    printUrl "" "me/$assignment"
    local path="me/$assignment"
    fileIsReadable "$path/index_histogram.php"
    fileIsReadable "$path/src/Dice/HistogramTrait.php"
    fileIsReadable "$path/src/Dice/DiceHistogram.php"
    fileIsReadable "$path/index_interface.php"
    fileIsReadable "$path/src/Dice/Histogram.php"
    fileIsReadable "$path/src/Dice/HistogramInterface.php"
    fileIsReadable "$path/src/Dice/DiceHistogram2.php"
    fileIsReadable "$path/src/Dice/HistogramTrait2.php"

    # Files related to me/redovisa
    fileIsReadable "me/redovisa/doc/class/codecoverage2.png"
}



#
# Test oophp kmom
#
oophpkmom05()
{
    #oophprepo "redovisa" "5.0.0" "6.0.0"
    :
}



#
# Test oophp kmom
#
oophpkmom06()
{
    #oophprepo "redovisa" "6.0.0" "7.0.0"
    :
}



#
# Test oophp kmom
#
oophpkmom10()
{
    #oophprepo "redovisa" "10.0.0" "11.0.0"
    :
}
