C++ doesn't really check it the index you are trying to access is out of range or not. After compilation, an array is really just a pointer to the first element of the array. Accessing is done by taking the pointer to the first element, add the desired index as address offset to it, then read/write the data at the result address.
In this case, testArray[1][5] = 5;
will change something on the stack to be 5. That depends on what's immediately after the array in memory at the time of execution.
By the way, this is called a buffer overflow error, which is a common security issue. In C++, you have the obligation to make sure that array index never exceed it's range. Or else it could lead to unexpected behaviour, crash the program or worse, lead to a remote code execution security issue.