This is called "Moroni's Promise" and is a scripture mormons memorize and repeat often to non-mormons when telling them about the gospel and giving them a copy of the Book of Mormon. The testimony, the faith, the knowledge that mormons have that their church is the one true church upon the face of the earth is based in this scripture. It works like this:
1. read the book of mormon
2. pray about it
3. the holy ghost gives you a happy feeling mormons call a "burning in the bosom" and you know the church is true and get baptized!
For people who are born mormon it tends to be more of growing up assuming it is true because you've just been told that since you were a little child over and over and your parents know it is true and they wouldn't lie to you! hopefully eventually you stop weaning from your parent's testimonies and use Moroni's Promise for yourself and of course the result will be that you will have a happy feeling and know that it is true and be a good righteous mormon.
If you do not receive a burning in your bosom mormons will say
-"you need to wait for god's answer. he answers in his own time."
-"you aren't listening for it enough/you have to try harder to hear the answer."
-"you aren't righteous enough/you need to be a better mormon before god will tell you that it is true!"
Sometimes if you fail to have the "burning in the bosom" you will be asked something like "well, did you have a bad feeling? If you didn't have a bad feeling the absence of a feeling means it is true. you didn't have a bad feeling so that was god's way of telling you it's true!"
If you prayed and had a bad feeling or a feeling that it wasn't true or just any feeling contrary to the answer that the church is true, well, that's just not possible! if you tell a mormon they will probably say something like this:
-"it was a feeling from Satan that you thought was a feeling from the holy ghost/god!" (wow, how can you tell who your feelings are from then? maybe Satan told you it was true and god gave me the real answer and said it was false.)
-"you wanted it to not be true so you already had your mind made up and it didn't matter what the answer really was." (I could say the same for having your mind made up already that it is true. I think the way mormons take on Moroni's Promise pretty much shows that they already have their mind made up and are just looking for a happy feeling to confirm what they already believe.)
Why isn't it possible to have a testimony that the church isn't true? a burning in the bosom that gives you an answer other than the "It's true!" answer? Well, since mormons know that it is, without a doubt, the one and only true church on the face of the earth, it just isn't possible that the answer could be anything contrary to that. If you try to ask a mormon something along the lines of "what if the church wasn't true?" most often you will get and answer like "It is true and I won't even think 'what if' because it's true and that's that." There really can't be a possibility in their mind that it could be untrue.
Anyway, my leaving the church came after years of serious "search, ponder, and pray." I felt uncomfortable and unhappy and scared to death in the church. I figured this must come from my doubt and me not being good enough or smart enough. It was a process of praying and begging god to give me the burning in my bosom that the church was true. Listening for that feeling and finding only emptiness. But I didn't give up and I couldn't just take nothing as being a confirmation of truth. I knew god would tell me and give me that testimony that I needed, the one Moroni had promised. I went on gaining knowledge that would help me to strengthen my testimony only to uncover more and more challenges. But however much troubling information that only made my testimony more challenged and however much researching to prove the claims false and finding them true, I still hung on waiting for an answer from god. I still believed. I couldn't even fathom not believing.
And one day the burning in my bosom came at last! but it was not what I expected. It was a feeling that the church wasn't true. A feeling of acceptance. A beautiful feeling of peace. A beautiful feeling of finally knowing. An amazing epiphany like nothing I have had before or since. The church was not true. And even though my entire world was crumbing in my hands with that realization...I felt so much peace and happiness. All of the fear I felt melted away! Because I finally knew. I guess you could say god did answer my prayers at last after so much pain and heartache and tears and pleading to him. It felt just like the feeling I was always taught would come. But it was the opposite answer. It was the most amazing epiphany ever.
Honestly, I don't really interpret it as god giving me an answer. I did not hear the voice of god or anything specifically "god-like" but the feeling was identical to what mormons describe about their bosom burnings. I think I can only really say that it was an epiphany. I guess you could interpret it as god guiding me but I think it was more like acceptance of what I already knew. I finally accepted the truth about things even though it was so hard to do. even though my "testimony" had been falling apart in the face of honest study of the church I still had not, until that point, accepted the answers in front of my face. So many times mormons say "I don't know what I would do without the church in my life! Without it I would be miserable and empty and have no reason to live. I feel sorry for people who do not have the gospel and I can see the empty and sad lives they lead because they do not have the truth in their lives!" I was scared. leaving the church was supposed to meean leaving everything behind and every possibility of true happiness. but I was already unhappy in the church.
As I grew up there were a lot of things I had trouble with about the church while I was still a good mormon but I tried to not let my personal feelings manipulate me...wait a minute! manipulate? feelings? what? If it's about having feelings that are from god why aren't my feelings meaningful when they are against the church too? Only the good feelings are talking about the church? That seems silly. In the end I think in matters of "truth" you can't really trust your feelings. What do you feel? what is making you feel that way? what does the feeling mean? you can try to interpret it yourself but with the LDS church they label those feelings for you. they tell you what you are feeling and what it means. they tell you the answer and you make your feelings conform to it. This certainly isn't how a person would successfully go about obtain knowledge of anything. Just having a feeling isn't enough to hold up to most scrutiny. in a courtroom you can tell the judge your client is innocent but if your only defense is "I just feel he is. I prayed about it and had a good feeling" that won't hold up. you will lose your case. The same can be said in almost any situation. Not that I believe there is no place for feelings or faith but if those are the things you a basing your decision on, especially important and life altering decision, it won't stand up. basically, feelings cannot be held as truth. you can feel a certain way about something and it could be true or false but your feeling isn't always going to match up. it's a feeling.